Go Down

Topic: SdFat seek() and position() functions? (Read 1 time) previous topic - next topic

dgelman

Hello

My project includes incoming data being processed and logged into an SD card, using the Arduino DUE.  Lets say I have a file.csv with entries looking like A,B,C,D (A,B are ints and C,D are floats).

FILE.CSV

A,B,C,D
A,B,C,D
A,B,C,D
A,B,C,D
A,B,C,D
A,B,C,D
...

Now after logging, I want to read the values of 'D' starting from the buttom going up towards the top of the file. 

I recieved advice regarding seek() and position() as it may help me to do exactly what to do, but <SD.h> is compiling issues with <SdFat.h>.  Because I want fast reads (50Hz), I do not want to use a while() to scroll down each time.  Seek() using pointers which is perfect for my application.

Are there seek() and position() functions in SdFat?
Any other suggestions?

Daniel
Dialup is the future.

robtillaart

If there is not to much data in the file, why dont you read the whole file into an array and read that in reverse.

If you use sdfat.h than you better not use SD.h as the latter is more convenience level SD handling (IIRC) and the SDFat is for more detailed control.
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

marco_c

Either use one library or the other.

My choice is for sdfat as it is more stable and gerenrally works faster.

The functions you are looking for exist and are very well documented in the sdfat documentation.
Arduino libraries http://arduinocode.codeplex.com<br />Parola for Arduino http://parola.codeplex.com

Go Up