This is a part of my program which reads data from file stored in SD card and displays that on an LCD screen.
File dataFile = SD.open("1165.txt");
if (dataFile) {
Serial.println("File Opened");
lcd.clear();
delay( 5 ); //LCD-specific M
lcd.setCursor( 0,0 );
while (dataFile.available()) {
Serial.write(dataFile.read());
lcd.write(dataFile.read());
lcd.print(dataFile.read());
}
dataFile.close();
} else {
// if the file didn't open, print an error:
Serial.println("error");
}
When I look at the serial monitor it prints the contents of that file but none of these commands print what is printed in the serial monitor,
lcd.write(dataFile.read());
lcd.print(dataFile.read());
Any ideas?