Hello,
I am trying to read a small file from an SD card to a string variable. I can't seem to figure it out. What do I need to do here? I have no trouble reading to the console as it is but I need read to the variable phoneNumbers.
char phoneNumbers[100];
phoneNum = SD.open("phoneNum.txt", FILE_READ);
if (! phoneNum) {
Serial.println("error opening phoneNum.txt");
// Wait forever since we cant read data
while (1) ;
}
if (phoneNum) {
while (phoneNum.available()) {
Serial.write(phoneNum.read());
}
phoneNum.close();
}
I want to subsistute phoneNumbers in place of Serial.write so I can parse it.
StanK