Hi,
I'm trying to log accelerometer to SDCard and display it on TinyScreen.
Everything should be fine but nothing is write on the Card
- The card is Formated
- The SD example ar OK
- I use TinyScreen + TinySD + TinyUSB + TinyDuino
void setup(void) {
Serial.begin(9600); while (!Serial) { ; }
Wire.begin();
...
Serial.print("Initializing SD card...");
pinMode(10, OUTPUT);
if (!SD.begin(10)) { Serial.println("Card failed, or not present"); return; }
}
void writeSD(long delta, long time){
File dataFile = SD.open("datalog.json", FILE_WRITE);
String str = "{ \"delta\": " + String(delta*250/1000) + ", \"duration\":" + String(time*250/1000) + "}";
dataFile.println(str);
dataFile.close();
if (SD.exists("datalog.json")) {
Serial.println("datalog.json exists.");
}
}
And SD.exists() return it do not exists ... any idea ?