Hi!
I'm using mentioned shield on Uno.
Communication is over HW serial.
3 different MP3's are played according to keys pressed and connected to inputs 10, 11, 12.
Blink_without_delay uses LED on 13, for debugging, to see, if the loop keeps running.
After day or two system crashes. All status-LEDs are ON, like the have to be, LED on 13 is OFF, and buttons does not work.
Commands are sent to the shield like they has to be.
Is there any ascpect I have to pay attention to?
At the moment each button forces MP3 shield to do this:
0xA4: Stop (to be sure previous track is stopped)
0xA7: set good volume
0xA9: configure playing mode
0xA0: select track
delay(700): play this track at this volume for some time.
0xA7: set new higher volume
delay(700): play this track at this volume for some time.
0xA7: set new higher volume
delay(700): play this track at this volume for some time.
0xA7: set new higher volume
delay(3000): play this track at this volume for some time.
And if this time passes, the track can play til the end, it does not start playing over and over again.
Code is like this:
/////////////////
cmd_buf[0] = 0x7E; // START
cmd_buf[1] = 0x02; // Length
cmd_buf[2] = 0xA4; // Command SET MODE
cmd_buf[3] = 0x7E; // END
ArduinoMP3Shield_SendCMD(cmd_buf, 4);
/////////////////
/////////////////
cmd_buf[0] = 0x7E; // START
cmd_buf[1] = 0x03; // Length
cmd_buf[2] = 0xA7; // Command
cmd_buf[3] = 0x11; // new volume 5
cmd_buf[4] = 0x7E; // END
ArduinoMP3Shield_SendCMD(cmd_buf, 5);
/////////////////
/////////////////
cmd_buf[0] = 0x7E; // START
cmd_buf[1] = 0x03; // Length
cmd_buf[2] = 0xA9; // Command SET MODE
cmd_buf[3] = 0x00; // set mode
cmd_buf[4] = 0x7E; // END
ArduinoMP3Shield_SendCMD(cmd_buf, 5);
/////////////////
/////////////////
cmd_buf[0] = 0x7E; // START
cmd_buf[1] = 0x04; // Length
cmd_buf[2] = 0xA0; // Command For U Disk change this line to 0xA2
cmd_buf[3] = 0x00; // file number high byte
cmd_buf[4] = 0x02; // file number low byte Actual track number
cmd_buf[5] = 0x7E; // END
ArduinoMP3Shield_SendCMD(cmd_buf, 6);
/////////////////
delay(700);
/////////////////
cmd_buf[0] = 0x7E; // START
cmd_buf[1] = 0x03; // Length
cmd_buf[2] = 0xA7; // Command
cmd_buf[3] = 0x14; // new volume
cmd_buf[4] = 0x7E; // END
ArduinoMP3Shield_SendCMD(cmd_buf, 5);
/////////////////
delay(700);
/////////////////
cmd_buf[0] = 0x7E; // START
cmd_buf[1] = 0x03; // Length
cmd_buf[2] = 0xA7; // Command
cmd_buf[3] = 0x17; // new volume 5
cmd_buf[4] = 0x7E; // END
ArduinoMP3Shield_SendCMD(cmd_buf, 5);
/////////////////
delay(700);
/////////////////
cmd_buf[0] = 0x7E; // START
cmd_buf[1] = 0x03; // Length
cmd_buf[2] = 0xA7; // Command
cmd_buf[3] = 0x19; // new volume 5
cmd_buf[4] = 0x7E; // END
ArduinoMP3Shield_SendCMD(cmd_buf, 5);
/////////////////
delay(700);
/////////////////
cmd_buf[0] = 0x7E; // START
cmd_buf[1] = 0x03; // Length
cmd_buf[2] = 0xA7; // Command
cmd_buf[3] = 0x19; // new volume 5
cmd_buf[4] = 0x7E; // END
ArduinoMP3Shield_SendCMD(cmd_buf, 5);
/////////////////
delay(3000);
Question is that does it has to crash when I use it like this or is there something else?
Thank you for your time,
Heldur