Ok, so im working to read back from an SD card saved file. The file opens fine and starts to read fine but then goes haywire.
File Test_File= SD.open("test.csv"); //open file without write privileges
while (Test_File.available() > 0 && mode_string == "Playback") // Read file until end and
{
int input_Char = Test_File.read(); //read one character
if (input_Char != '\n') //if character isnt new line
{
if (input_Char != ';') //if character is not a comma, as this is the delimiter
{
delay(Read_speed);
Serial.println(input_Char); //put in for testing to ensure that the correct char is inputted
input_String[number] += input_Char; // As long as the incoming bytes are not a newline or a comma, add to string
}
else
{
number += 1; //end of the first reading was received per the comma, increment the array to store next reading.
delay(Read_speed); //used to troubleshoot
}
The csv file has the following:
Test1;
Test2;
Test3;Test4
Test5;Test6
This seems to work until the end of the first read line. Then i get a bunch of garbage.
Any help would be nice.
Thanks in advance.