Hi all,
I’m starting a project that requires the SD Card module, I’ve used it fine in the past but for some reason it is now giving me some trouble.
I have a cerberus and the SD Card module attached to socket 7.
Currently I’m just trying to get a list of files from a directory but this isn’t working, I keep getting System.IO.IOException (directory not found).
Here is my Mounted event handler:
void sdCard_SDCardMounted(SDCard sender, GT.StorageDevice SDCard)
{
string[] directories = SDCard.ListRootDirectorySubdirectories();
Debug.Print(directories.ToStrings());
string[] subDirectories = SDCard.ListFiles(SDCard.RootDirectory + @ "\" + directories[0]);
Debug.Print(subDirectories.ToStrings());
}
(I have written the .ToStrings() method as an extension to string[] and it just prints each string on a newline).
For some reason, SDCard.ListRootDirectorySubdirectories() works but SDCard.ListFiles(SDCard.RootDirectory + directories[0]) does not. I’m following the way it is dont on the SD Card Module tutorial here (https://www.ghielectronics.com/docs/96/sd-card-module).
Does anyone know why this isn’t working?
Thanks for your time.
P.S. The card is FAT and I know it is being read because I can print the string[] returned from SDCard.ListRootDirectorySubdirectories();