hi,
Thanks for your answers.
I save the data in SD using the sketch AnalogLogger.
I just changed to make only 10 samples.
Inside the file:
millis,date,time,sens0,sens1,sens2
3600,2000/1/1,0:00:00,498,390,338
3700,2000/1/1,0:00:00,405,373,346
3800,2000/1/1,0:00:00,368,357,338
3900,2000/1/1,0:00:00,353,342,331
4000,2000/1/1,0:00:00,342,331,324
4100,2000/1/1,0:00:00,328,324,315
4200,2000/1/1,0:00:00,324,316,310
4300,2000/1/1,0:00:00,319,310,306
4400,2000/1/1,0:00:00,309,306,299
4500,2000/1/1,0:00:00,308,301,296
And use the following code to read the contents of the file.
const int chipSelect = 4;
#include <SdFat.h>
SdFat sd;
SdFile myFile;
uint8_t buf[450];
ArduinoOutStream cout(Serial);
void setup()
{
Serial.begin(9600);
if (!sd.init(SPI_FULL_SPEED, chipSelect)) sd.initErrorHalt();
if (!myFile.open("LOGGER00", O_READ)) {
sd.errorHalt("opening test.txt for read failed");
}
int data;
//while ((data = myFile.read()) > 0) Serial.write(data);
Serial.println(millis());
myFile.read(buf,340);
cout << buf << endl;
Serial.println(millis());
myFile.close();
}
void loop()
{
}
I pulled the file extension to see if it would be faster but did not result.
Can you tell me how can I read faster or say what am I doing wrong?
Greetings