<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://lms.onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=Arduino%3A_CD_card_check_%26_info</id>
	<title>Arduino: CD card check &amp; info - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://lms.onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=Arduino%3A_CD_card_check_%26_info"/>
	<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=Arduino:_CD_card_check_%26_info&amp;action=history"/>
	<updated>2026-04-21T04:20:44Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://lms.onnocenter.or.id/wiki/index.php?title=Arduino:_CD_card_check_%26_info&amp;diff=51124&amp;oldid=prev</id>
		<title>Onnowpurbo at 08:57, 25 May 2018</title>
		<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=Arduino:_CD_card_check_%26_info&amp;diff=51124&amp;oldid=prev"/>
		<updated>2018-05-25T08:57:43Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 08:57, 25 May 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l47&quot;&gt;Line 47:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 47:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    // (10 on most Arduino boards, 53 on the Mega) must be left as an output  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    // (10 on most Arduino boards, 53 on the Mega) must be left as an output  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    // or the SD library functions will not work.  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    // or the SD library functions will not work.  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    pinMode(10, OUTPUT);     // change this to 53 on a mega&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;// &lt;/ins&gt;pinMode(10, OUTPUT);     // change this to 53 on a mega&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;   pinMode(4, OUTPUT);     // for Ethernet shield&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    // we&amp;#039;ll use the initialization code from the utility libraries&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    // we&amp;#039;ll use the initialization code from the utility libraries&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Onnowpurbo</name></author>
	</entry>
	<entry>
		<id>https://lms.onnocenter.or.id/wiki/index.php?title=Arduino:_CD_card_check_%26_info&amp;diff=49918&amp;oldid=prev</id>
		<title>Onnowpurbo: Created page with &quot; /*    SD card test         This example shows how use the utility libraries on which the&#039;   SD library is based in order to get info about your SD card.   Very useful for tes...&quot;</title>
		<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=Arduino:_CD_card_check_%26_info&amp;diff=49918&amp;oldid=prev"/>
		<updated>2018-01-04T01:14:29Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot; /*    SD card test         This example shows how use the utility libraries on which the&amp;#039;   SD library is based in order to get info about your SD card.   Very useful for tes...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt; /*&lt;br /&gt;
   SD card test &lt;br /&gt;
    &lt;br /&gt;
  This example shows how use the utility libraries on which the&amp;#039;&lt;br /&gt;
  SD library is based in order to get info about your SD card.&lt;br /&gt;
  Very useful for testing a card when you&amp;#039;re not sure whether its working or not.&lt;br /&gt;
  	&lt;br /&gt;
  The circuit:&lt;br /&gt;
   * SD card attached to SPI bus as follows:&lt;br /&gt;
  ** MOSI - pin 11 on Arduino Uno/Duemilanove/Diecimila&lt;br /&gt;
  ** MISO - pin 12 on Arduino Uno/Duemilanove/Diecimila&lt;br /&gt;
  ** CLK - pin 13 on Arduino Uno/Duemilanove/Diecimila&lt;br /&gt;
  ** CS - depends on your SD card shield or module. &lt;br /&gt;
  		Pin 4 used here for consistency with other Arduino examples&lt;br /&gt;
 &lt;br /&gt;
  &lt;br /&gt;
  created  28 Mar 2011&lt;br /&gt;
  by Limor Fried &lt;br /&gt;
  modified 9 Apr 2012&lt;br /&gt;
  by Tom Igoe&lt;br /&gt;
  */&lt;br /&gt;
  // include the SD library:&lt;br /&gt;
 #include &amp;lt;SD.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 // set up variables using the SD utility library functions:&lt;br /&gt;
 Sd2Card card;&lt;br /&gt;
 SdVolume volume;&lt;br /&gt;
 SdFile root; &lt;br /&gt;
 &lt;br /&gt;
 // change this to match your SD shield or module;&lt;br /&gt;
 // Arduino Ethernet shield: pin 4&lt;br /&gt;
 // Adafruit SD shields and modules: pin 10&lt;br /&gt;
 // Sparkfun SD shield: pin 8&lt;br /&gt;
 const int chipSelect = 4;     &lt;br /&gt;
 &lt;br /&gt;
 void setup()&lt;br /&gt;
 {&lt;br /&gt;
   // Open serial communications and wait for port to open:&lt;br /&gt;
   Serial.begin(9600);&lt;br /&gt;
   while (!Serial) {&lt;br /&gt;
     ; // wait for serial port to connect. Needed for Leonardo only&lt;br /&gt;
   }&lt;br /&gt;
  &lt;br /&gt;
   Serial.print(&amp;quot;\nInitializing SD card...&amp;quot;);&lt;br /&gt;
   // On the Ethernet Shield, CS is pin 4. It&amp;#039;s set as an output by default.&lt;br /&gt;
   // Note that even if it&amp;#039;s not used as the CS pin, the hardware SS pin &lt;br /&gt;
   // (10 on most Arduino boards, 53 on the Mega) must be left as an output &lt;br /&gt;
   // or the SD library functions will not work. &lt;br /&gt;
   pinMode(10, OUTPUT);     // change this to 53 on a mega&lt;br /&gt;
&lt;br /&gt;
   // we&amp;#039;ll use the initialization code from the utility libraries&lt;br /&gt;
   // since we&amp;#039;re just testing if the card is working!&lt;br /&gt;
   if (!card.init(SPI_HALF_SPEED, chipSelect)) {&lt;br /&gt;
     Serial.println(&amp;quot;initialization failed. Things to check:&amp;quot;);&lt;br /&gt;
     Serial.println(&amp;quot;* is a card is inserted?&amp;quot;);&lt;br /&gt;
     Serial.println(&amp;quot;* Is your wiring correct?&amp;quot;);&lt;br /&gt;
     Serial.println(&amp;quot;* did you change the chipSelect pin to match your shield or module?&amp;quot;);&lt;br /&gt;
     return;&lt;br /&gt;
   } else {&lt;br /&gt;
     Serial.println(&amp;quot;Wiring is correct and a card is present.&amp;quot;); &lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
   // print the type of card&lt;br /&gt;
   Serial.print(&amp;quot;\nCard type: &amp;quot;);&lt;br /&gt;
   switch(card.type()) {&lt;br /&gt;
     case SD_CARD_TYPE_SD1:&lt;br /&gt;
       Serial.println(&amp;quot;SD1&amp;quot;);&lt;br /&gt;
       break;&lt;br /&gt;
     case SD_CARD_TYPE_SD2:&lt;br /&gt;
       Serial.println(&amp;quot;SD2&amp;quot;);&lt;br /&gt;
       break;&lt;br /&gt;
     case SD_CARD_TYPE_SDHC:&lt;br /&gt;
       Serial.println(&amp;quot;SDHC&amp;quot;);&lt;br /&gt;
       break;&lt;br /&gt;
      default:&lt;br /&gt;
       Serial.println(&amp;quot;Unknown&amp;quot;);&lt;br /&gt;
   } &lt;br /&gt;
 &lt;br /&gt;
   // Now we will try to open the &amp;#039;volume&amp;#039;/&amp;#039;partition&amp;#039; - it should be FAT16 or FAT32&lt;br /&gt;
   if (!volume.init(card)) {&lt;br /&gt;
     Serial.println(&amp;quot;Could not find FAT16/FAT32 partition.\nMake sure you&amp;#039;ve formatted the card&amp;quot;);&lt;br /&gt;
     return;&lt;br /&gt;
   } &lt;br /&gt;
 &lt;br /&gt;
   // print the type and size of the first FAT-type volume&lt;br /&gt;
   uint32_t volumesize;&lt;br /&gt;
   Serial.print(&amp;quot;\nVolume type is FAT&amp;quot;);&lt;br /&gt;
   Serial.println(volume.fatType(), DEC);&lt;br /&gt;
   Serial.println();&lt;br /&gt;
   &lt;br /&gt;
   volumesize = volume.blocksPerCluster();    // clusters are collections of blocks&lt;br /&gt;
   volumesize *= volume.clusterCount();       // we&amp;#039;ll have a lot of clusters&lt;br /&gt;
   volumesize *= 512;                            // SD card blocks are always 512 bytes&lt;br /&gt;
   Serial.print(&amp;quot;Volume size (bytes): &amp;quot;);&lt;br /&gt;
   Serial.println(volumesize);&lt;br /&gt;
   Serial.print(&amp;quot;Volume size (Kbytes): &amp;quot;);&lt;br /&gt;
   volumesize /= 1024;&lt;br /&gt;
   Serial.println(volumesize);&lt;br /&gt;
   Serial.print(&amp;quot;Volume size (Mbytes): &amp;quot;);&lt;br /&gt;
   volumesize /= 1024;&lt;br /&gt;
   Serial.println(volumesize);&lt;br /&gt;
  &lt;br /&gt;
   Serial.println(&amp;quot;\nFiles found on the card (name, date and size in bytes): &amp;quot;);&lt;br /&gt;
   root.openRoot(volume);&lt;br /&gt;
  &lt;br /&gt;
   // list all files in the card with date and size&lt;br /&gt;
   root.ls(LS_R | LS_DATE | LS_SIZE);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 void loop(void) { &lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Onnowpurbo</name></author>
	</entry>
</feed>