#include #define CS_PIN 10 File root; void setup() { Serial.begin(115200); Serial.print("Initializing SD card... "); if (!SD.begin(CS_PIN)) { Serial.println("Card initialization failed!"); while (true); } Serial.println("initialization done."); // Example of writing file from the card: File myFile = SD.open("Peppe8o.txt", FILE_WRITE); myFile.println("Hello, SD Card!"); myFile.println("Card is opened by Peppe80"); myFile.close(); // Example of reading file from the card: myFile = SD.open("Peppe8o.txt"); if (myFile) { Serial.print("Peppe8o.txt: "); while (myFile.available()) { Serial.write(myFile.read()); } myFile.close(); } else { Serial.println("error opening Peppe8o.txt!"); } } void loop() { // nothing happens after setup finishes. }