Cannot access SD card on WINC1500 I have a WINC1500 shield and have the Wi-Fi side working fine. I want to do some datalogging to the SD card and am having trouble getting it running. I have bought a 16 GB Sandisk card and inserted it. I have added the SD library, SD.h is included. However SD.begin() fails. I have a Mega2560 card (from Elegoo) so should be able to run the SD and wifi at the same time? Do I need to pass a parameter to SD.begin()?

The code below always prints "Card failed to initialise, or not present".

if(!SD.begin())
{
    Serial.println("Card failed to initialise, or not present");
}
else
{
    Serial.println("Card initialised ok");
}
Do I need to pass a parameter to SD.begin()?


Yes, you need to pass the Chip-Select (CS/SS) pin number. What number depends on how you have it hooked up, the default is 10. (yours might be 4)

n.b. according to the docs a standard arduino can't use the WiFi, and the SD at the same time; presumably the mega has enough memory.