Below is older code I used to instruct a mp3 player to play and stop successfully.
void setup() {
Serial.begin(9600);
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, HIGH); // set the LED on
Serial.print(02,BYTE); // Command byte
Serial.print(160,BYTE); // Command byte - mp3 player PLAY
delay(5000); // wait for five second
digitalWrite(13, LOW); // set the LED off
Serial.print(02,BYTE); // Command byte
Serial.print(162,BYTE); // Command byte - mp3 player STOP
delay(5000); // wait for five second
}
I have attempted to modify the code to work with Arduino 1.0, but I have been unsuccessful to get it to work with the mp3 player.
void setup() {
Serial.begin(9600);
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, HIGH); // set the LED on
Serial.write(02); // Command byte
Serial.write(160); // Command byte - mp3 player PLAY
delay(5000); // wait for five second
digitalWrite(13, LOW); // set the LED off
Serial.write(02); // Command byte
Serial.write(162); // Command byte - mp3 player STOP
delay(5000); // wait for five second
}
Thank you for any feedback!