Ok so I am trying to read a txt file from the SD card (the file was written from the arduino and moved to a different directory) I am using the code below to convert the # but I can see I am getting Line feed and Carriage return #'s(-35, -38). How should I correct this? The # should be 259
Thank you for your help.
Reading Speed File
10000.00
2.00
5.00
9.00
-35.00
-38.00
25512.00
0.00
void AvgspeedR() {
enableSPI();
char AvgSR[27];
sprintf(AvgSR, "/Read/Speed/speed%03d.txt", B+39);
File myFile1 = SD.open(AvgSR);
if (myFile1)
{
Serial.println("Reading Speed File");
float decade = pow(10, (myFile1.available() - 1));
Serial.println (decade);
while(myFile1.available())
{
float temp3 = (myFile1.read() - '0');
Serial.println (temp3);
Matchspeed = temp3*decade+Matchspeed;
decade = decade/10;
}
Serial.println (Matchspeed);
Matchspeed = 0;
Serial.println (Matchspeed);
myFile2.close();
}
disableSPI();
}