Need help with accessing\detecting built-in microSD card in FEZ Cobra III

Need help with accessing\detecting built-in microSD card in FEZ Cobra III
Call me stupid, but I cannot find a working example here.

@ EvoMotors - where did you look? There is a document in the support section.

And just so it’s hard to miss,

https://www.ghielectronics.com/docs/51/accessing-folders-and-files

Yes, I managed to miss. Thank you.

I used example to detect card from documentation and it’s not working.


//Make sure to set the pin to your sd card detect pin.
InputPort sdCardDetect = new InputPort(GHI.Pins.FEZCobraIII.Gpio.SdCardDetect, false, Port.ResistorMode.Disabled)
bool sdDetected = sdCardDetect.Read();

sdDetected always return false;

I use a try catch block when I try to mount or write or read from the SD and use this as a way to check it if inserted. I’ve never bothered with the CARD DETECT on any design and this works 100% of the time.

Anyway, change the PIN to be P2_11 and see if that works?

Enable the resistor pullup on this. There is no physical pullup on the board is the input will always be seen as LOW.

Thank you Dave. Enabling pull up worked beautifully! The only thing is now instead of


will be 

```cs]bool sdExists = !sdCardDetect.Read();[/code

So their example from documentation is incorrect. But who cares as long as it works.

Thanks again.