Hi all. I am using a Seeedstudio SD Shield on my Arduino, and using the SD library that ships with the current Arduino package, I’m seeing some issues.
First of all, the example code that prints out a directory does not close the files that it opens up.
Secondly, here’s the main issue i’m seeing:
- get a directory listing (using the code from the included examples)
- create a file (or read a file) (using code from the included examples)
- get a directory listing again (same code as 1 above)
The second directory listing is missing a significant amount of files. The first time, i see 25 files, the second time, and all subsequent calls to get a directory listing, i see only 10 files.
I’ve tried this on multiple cards of varying speeds and sizes, and see the same results.
(This is ultimately for my TinyBasicPlus Arduino BASIC port, so i need to be able to get the directory listing multiple times, etc)
Attached is the .ino showing this issue. Any help or suggestions would be appreciated.
listfiles_testing.ino (2.46 KB)