Hello everyone. Thank you for Arduino!
This is nothing new, but I have a 2 line display, I have an SD card reader.
I have got a sketch that will read 4 'messages' from the SD card and display them on the screen.
However, I was thinking it would be great if the Arduino could/would, rather than load all 4 messages into precious memory, instead would just read the 'next' message on the SD card...
Thinking through this, I have a couple of questions and maybe need some guidance?
Does someone know of an SD library that will read the contents of a file, line by line, keeping track of where it is?
Each message actually has 3 lines in the file...
Message1Text =, Message1Delay=, Message1Type=
Would I simply have in the file, a sequence of three lines -
MessageText=
MessageDelay=
MessageType=
MessageText=
MessageDelay=
MessageType=
MessageText=
MessageDelay=
MessageType=
I was also considering opening and closing the SD card everytime, but that sounds like a nightmare and an ever-growing delay as the Arduino goes to the index location in the file.
I am currently using "SDCONFIG FILE" by Fuzzer11 ( GitHub - Fuzzer11/SDconfig: Arduino Library to read an SD Configuration File ) forked from bneedhamia ( GitHub - bneedhamia/sdconfigfile: Arduino Library to read an SD Configuration File )
I'd like to not have to put an INT or something at the top of the file to tell how many messages there are, just read until the end, start over??
Thank you!