Pages: [1]   Go Down
Author Topic: SdFat seek() and position() functions?  (Read 931 times)
0 Members and 1 Guest are viewing this topic.
London, ON
Offline Offline
Jr. Member
**
Karma: 0
Posts: 72
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Dialup is the future.

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13531
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Rob Tillaart

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

Sydney, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1259
Big things come in large packages
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Arduino libraries http://arduinocode.codeplex.com
Parola hardware & library http://parola.codeplex.com

Pages: [1]   Go Up
Jump to: