Hey guys,
I am using an arduino Uno connected with sd card and an adafruit adapter and a pushbutton. When the push-button is pressed it takes the time using the millis function and stores it to a file in Sd card. My problem occurs when I am trying to code it to send the file to the serial port and nothing happens. I am trying to send the number 1 through the serial monitor and then the micro controller display back the file. Here's the code
if (Serial.read() == 1) {
if (!dataFile.open("datalog.txt", O_READ)) {
sd.errorHalt("opening datalog.txt for read failed");
}
Serial.write(dataFile.read());
// close the file:
dataFile.close();
}