SparkFun will be closed Monday 7/4 for the holiday. All orders placed after 2pm MT on Friday 7/1 will be shipped out next week.
Track My Order
Frequently Asked Questions
International Shipping Info
Mon-Fri, 9am to 12pm and
1pm to 5pm U.S. Mountain Time:
Chat With Us
September 22, 2009
about 6 years ago
The sample code for this shield has a few problems:
1) fat16.cpp has a comment in FAT::Write that said it will always write to EOF. It will not because the second argument to fat_seek_file was 0 and not a pointer to an offset as it needs to be.
2) fat16_example.pde says read(buffer) will read sizeof buffer. The actual read routine will read 512 bytes regardless of the size of the buffer.
3) When the test file gets >512 bytes the example will fail.
4) fat16.cpp should be rewritten to: a) return more error indications b) take size args, rather than assume strings c) have seek function.
I’ve fixed the items above. Let me know if you want it posted somewhere.
I’m successfully using this code with a shield that takes regular SD cards instead of microSD cards. The SD shield can get its power from the 3.3v supply on the Duemilenove board. This code works much better than the filelogger/nanofat code that came with the SD shield. The nanofat code takes 300 milliseconds on every write call. This code takes less than 2 milliseconds.
The only advantage to the nanofat code is that it is 9000 bytes smaller than this code.
No public wish lists :(
Forgot your password?
No account? Register one!