The sketch that I used for logging to an SD Card is available here for download. It is pretty much based on the examples from the Arduino download but with a couple of interesting notes:
Nothing special here except that at one point I had put the initialization of the card where it could get executed twice. Fail! It is much happier in the setup section with one time things.
Prior to starting to make observations we open an output file.
Almost certainly overkill, but, I wanted to have the most dense data logging possible so am logging two longs in eight bytes. Pretty much their native size if not format. I have not done a timing between doing this and saving as ascii but I would hope for this to be more efficient!?!?
If we are logging to an SD card we may well NOT be doing anything further with it on the Arduino but I wanted to do so anyway. Obviously we had closed and reopened the logging file and then I use this function to reach into that file and get the eight bytes that were logged.
Finally, an example of getting back the long value that had been saved. In this case the voltage reading.
This code captured and logged at the rate of about 860 observations per second.