#include RogueSD ummc(Serial1); void setup() { int8_t filehandle; Serial.begin(9600); Serial1.begin(9600); // this just makes sure we have a nice random number later randomSeed(analogRead(0)); // prepare the communications with the uMMC and closes all open files (if any) ummc.sync(); // open a file (append data) filehandle = ummc.open("/filetest.txt", OPEN_APPEND); if(filehandle > 0) { Serial.println("File opened."); // append some data ummc.writeln_prep(filehandle); // you can use any of the standard print methods to send data to the file. ummc.print("You'll see this many times in this file. RAND: "); ummc.print(random(10000)); ummc.writeln_finish(); Serial.println("Append complete."); ummc.close(filehandle); Serial.println("File closed."); } else { Serial.print("ERROR: "); Serial.println(ummc.LastErrorCode, HEX); } } void loop() { }