I am working with a music shield, I have got my code from this site https://www.waveshare.com/Music-Shield.htm it works fine with arduino UNO but when I try to use it on MEGA it give me errors, Well I found that the problem is with this line
card.init(SPI_FULL_SPEED,SD_CS_PIN)
in uno SD_CS_PIN=10
I tried to change it to 53
based on this map
SPI Uno Mega
SS 10 53
MOSI 11 51
MISO 12 50
SCK 13 52
which is available on https://forum.arduino.cc/index.php?topic=165170.30 but still it returns false. What other options do I have to make it work on MEGA
?
Thing that I am trying
#define SD_CS_PIN=10
#define VS_XRESET A0
#define VS_DREQ A1
#define VS_XDCS A2
#define VS_XCS A3
void VS10XX::init(void)
{
SPI.begin();
SPI.setClockDivider(SPI_CLOCK_DIV2);
pinMode(53, OUTPUT);
pinMode(VS_XRESET, OUTPUT);
pinMode(VS_DREQ, INPUT);
pinMode(VS_XDCS, OUTPUT);
pinMode(VS_XCS, OUTPUT);
digitalWrite(VS_XDCS, HIGH);
digitalWrite(VS_XCS, HIGH);
reset();
}
In setup I added used this code but still does not work
void setup()
{
Serial.begin(115200);
pinMode(53, OUTPUT);//setting pin 53 to input
player.begin();
}
the error code when I attempt to init
sd card is 0
which says
/** timeout error for command CMD0 */
setup()
but still does not work