Im trying to display text in a file from SD card.
I can read the first line up to the 2nd to the last line. When I try ko read the last line the program stops running an LCD displays all white squares. what am I doing wrong here?
here is the code:
myFile.seek(0);
char cr;
for(unsigned int i = 0; i < 15;){
cr = myFile.read();
if(cr == '\n')
{
i++;
}
}
while(true){
cr = myFile.read();
if((cr == '\n')||(cr == '\r'))
break;
lcd.print(cr);
}
I attached a picture of what the LCD displays.
here is the list of what is written inside the fie:
00.1
SUN
00.00.0001
00:00:01
00.2
MON
00.00.0002
00:00:02
00.3
WED
00.00.0003
00:00:03
00.4
THU
00.00.0004
00:00:04