I have a txt file with a single integer in it (eg; "10"). I need to read it and display it on the LCD. I can read it into the serial display, and write files onto the text file, but I can not make my integer "count" equal to the value in the txt file.
dataCount = SD.open("count.txt");
if (dataCount) {
while (dataCount.available()) {
//*********ALL COMBINATIONS I HAVE TRIED*********
dataCount.read();
Serial.write(dataCount.read());
int count = Serial.read();
write(dataCount.read()
int count = Serial.write(dataCount.read());
count == (dataCount.read());
}}
//dataCount.read() == count;
//int count = (dataCount.read());
//close the file:
dataCount.close();
Serial.println (count);
I get "count = -1" which is the return if the read value is not available.
To clarify; txt file "dataCount" holds a single value in txt format that I need to convert to a byte to set as an integer in my program.
Thanks guys!