Hi guys, I'm pretty new to programming in arduino and I'm working on a project that I'm trying to integrate some sound into. I started with an arduino uno redboard.
I bought the SparkFun MP3 Player Shield (SparkFun MP3 Player Shield - DEV-12660 - SparkFun Electronics) got it installed, went through the hookup guide and loaded up the FilePlayer example. I had to modify the baud value from 115200 to 9600 because I was only getting giberish on the serial monitor. Once I fixed that, it worked when I typed in 001, 002, 003, 004 and so on, playing the respective files. It didn't however work when I typed only 1,2,3,or 4 as the comments seem to suggest it should.
Now, I've searched the internet for more information on how to actually use this in code and I keep coming back to this code:
#include <SPI.h>
#include <SdFat.h>
#include <SdFatUtil.h>
#include <SFEMP3Shield.h>
SdFat sd;
SFEMP3Shield MP3player;
void setup() {
Serial.begin(9600);
//start the shield
sd.begin(SD_SEL, SPI_HALF_SPEED);
MP3player.begin();
//start playing track 1
MP3player.playTrack(1);
}
//do something else now
void loop() {
Serial.println("I'm bored!");
delay(2000);
}
When I run this code, I can hear the speaker kick on for a second but nothing plays.
Any help would be greatly appreciated!