It seems to me that CS pin of the the AZDelivery micro SD card shield does not work with the pin 53 of Arduino Mega, like other micro SD card shields do.
Is anybody aware of the reason why using this wiring:
MOSI pin 50
MISO pin 51
SCK pin 52
CS pin 53
GND pin GND
VCC pin 5 volt
the execution hangs where the *** FAILURE *** string is marked?
Thank you.
Here is the code:
#include <SD.h>
File myFile;
void setup()
{
Serial.begin(9600);
while (!Serial) {
;
}
Serial.print(“1.Initializing SD card…”);
pinMode(53, OUTPUT);
if (!SD.begin(53)) {
Serial.println(“1.1. initialization failed!”); // ********** FAILURE ***************
return;
}