Using BDubs SD card library

Hi,

I just played around with BDubs sd card library. Works very nice. But I have a little problems understanding the initialization stuff and the reading of directories.
There are two examples there:

  • Spark-CardInfo
    which opens the root directory and displays it’s contents. It uses card.init to start up the library
  • Spark-ReadWrite
    which writes and reads files. It uses SD.begin to start up.

I want to use both: reading/displaying the directory and reading files. If I use SD.init I cannot read the directory the way shown in the CardInfo example. If I use the CardInfo way I cannot open files.

Can you give me some hints how to do it right?

BTW: my card seems to be formatted as a “super floppy” without a partition table. So the SD.begin prints an error message, but mounts the card anyway. That’s not nice. I would suggest to disable all the messages of the library maybe with a DEFINE switch. So the user can react to the returncode of the library like he wants.

I’m not that familiar with the SD extactly but @Hootie81 or @marcus might have some clue!

Im not sure which library i use… but the SD begin calls init then 2 other functions. I use it to save/read files and im not too interested in what else is on the card.

When i get some time next week ill have a look at the examples and test them with my card which is fat formatted.

1 Like