I am working on a project that measures people heartbeat for a timespan of 10s and displaying the average BPM with the LED strip. I want to play some music while it is measuring during that 10s and also when the BPM is being displayed on the LED strip. However, the songs aren't being played. I printed out the MP3player.isPlaying() command and it gave me a value of 3 which meant that VSdsp is in reset, but I don't understand what it means. The MP3 player works when I try playing it on a new sketch though. Attached is my code.
x-post from: https://www.reddit.com/r/arduino/comments/8g7t7i/bareconductive_touchboard_mp3_not_playing/ and https://arduino.stackexchange.com/questions/52344/bareconductive-touchboard-mp3-not-playing
LED_Functions.ino (3.97 KB)
sketch_apr13a.ino (12.7 KB)
result = MP3player.begin();
MP3player.setVolume(10, 10);
if(result != 0)
{
Serial.print("Error code: ");
Serial.print(result);
Serial.println(" when trying to start MP3 player");
}
Serial.begin(115200);
If the MP3 player doesn't begin, set the volume, then print some error messages, then start the Serial instance. Seems to me that some reordering of these statements is required.
Until you know that the MP3 player is working, studying the rest of the code is pointless.
It does begin since I dont see any of the error messages in the serial monitor.
It does begin since I dont see any of the error messages in the serial monitor.
You don't KNOW that. You don't see the error messages in the serial monitor because you don't call begin() until AFTER you have (uselessly) called print().
Alright I get what you mean
So I reordered it and placed the Serial begin the beginning of the setup and the error message do not appear. Still, there is no music being played.
You changed the code. It still doesn't "work". Bummer.
Perhaps if we could see the new code...
So basically I just placed the Serial.begin as the first line in the setup function and also added a while(!Serial)
sketch_apr13a.ino (12.7 KB)
You have WAY too much code for the MP3 player not working. Disconnect everything except the MP3 player. Get rid of all the code that does not directly relate to the MP3 player.
Does THAT code work?
I commented all the code related to the MP3 player and everything works well, but I'm still not sure why the MP3 player isn't working.