je teste un clone shield adafruit rtc+sdcard, avec une vieille sdcard 128 megas formatée avec sdformatterv4 quickformat automatic, fat tout court, reconnu par cardinfo en fat16
l'exemple readwrite de la biblio sd :
#include <SD.h>
File myFile;
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
Serial.print("Initializing SD card...");
// On the Ethernet Shield, CS is pin 4. It's set as an output by default.
// Note that even if it's not used as the CS pin, the hardware SS pin
// (10 on most Arduino boards, 53 on the Mega) must be left as an output
// or the SD library functions will not work.
pinMode(10, OUTPUT);
if (!SD.begin(10)) { // // On the Ethernet Shield, CS is pin 4. shield arduino is pin 10 dans le cas uno
// dans l'exemple source c'est : if (!SD.begin(4)) !!!!!!!!
Serial.println("initialization failed!");
return;
}
Serial.println("initialization done.");
// open the file. note that only one file can be open at a time,
// so you have to close this one before opening another.
myFile = SD.open("test.txt", FILE_WRITE);