|
1 | 1 | /*
|
2 | 2 | SD card test
|
3 | 3 |
|
4 |
| - This example shows how use the utility libraries on which the' |
| 4 | + This example shows how use the utility libraries on which the |
5 | 5 | SD library is based in order to get info about your SD card.
|
6 | 6 | Very useful for testing a card when you're not sure whether its working or not.
|
7 |
| - Pin numbers reflect the default SPI pins for Uno and Nano models |
| 7 | + Pin numbers reflect the default SPI pins for Uno and Nano models. |
8 | 8 | The circuit:
|
9 | 9 | SD card attached to SPI bus as follows:
|
10 | 10 | ** SDO - pin 11 on Arduino Uno/Duemilanove/Diecimila
|
@@ -32,7 +32,7 @@ SdFile root;
|
32 | 32 | // Arduino Ethernet shield: pin 4
|
33 | 33 | // Adafruit SD shields and modules: pin 10
|
34 | 34 | // Sparkfun SD shield: pin 8
|
35 |
| -// MKRZero SD: SDCARD_SS_PIN |
| 35 | +// MKR Zero SD: SDCARD_SS_PIN |
36 | 36 | const int chipSelect = 10;
|
37 | 37 |
|
38 | 38 | void setup() {
|
@@ -96,13 +96,13 @@ void setup() {
|
96 | 96 |
|
97 | 97 | volumesize = volume.blocksPerCluster(); // clusters are collections of blocks
|
98 | 98 | volumesize *= volume.clusterCount(); // we'll have a lot of clusters
|
99 |
| - volumesize /= 2; // SD card blocks are always 512 bytes (2 blocks are 1KB) |
100 |
| - Serial.print("Volume size (Kb): "); |
| 99 | + volumesize /= 2; // SD card blocks are always 512 bytes (2 blocks are 1 KB) |
| 100 | + Serial.print("Volume size (KB): "); |
101 | 101 | Serial.println(volumesize);
|
102 |
| - Serial.print("Volume size (Mb): "); |
| 102 | + Serial.print("Volume size (MB): "); |
103 | 103 | volumesize /= 1024;
|
104 | 104 | Serial.println(volumesize);
|
105 |
| - Serial.print("Volume size (Gb): "); |
| 105 | + Serial.print("Volume size (GB): "); |
106 | 106 | Serial.println((float)volumesize / 1024.0);
|
107 | 107 |
|
108 | 108 | Serial.println("\nFiles found on the card (name, date and size in bytes): ");
|
|
0 commit comments