Hi everyone,
I use sparkFun MP3 shield with Arduino Uno using the following code:
#include "SdFat.h"
#include "SdFatUtil.h" // SDFat Util Library
#include <SFEMP3Shield.h> // Mp3 Shield Library
#include <SPI.h>
SdFat sd;
SFEMP3Shield MP3player;
const uint8_t volume = 0;
const uint16_t monoMode = 1;
char Track001[] = "Track001.mp3";
void setup() {
Serial.begin(115200);
void initSD();
void initMP3Player();
uint8_t result = MP3player.playMP3(Track001);
if (result == 0 )
Serial.println("OK");
if (result == 1 )
Serial.println("Already playing");
if (result == 2 )
Serial.println("failed to start");
}
void loop() {
// Do nothing //
}
void initSD()
{
//Initialize the SdCard.
if(!sd.begin(SD_SEL, SPI_HALF_SPEED))
sd.initErrorHalt();
if(!sd.chdir("/"))
sd.errorHalt("sd.chdir");
}
void initMP3Player()
{
uint8_t result = MP3player.begin(); // init the mp3 player shield
if(result != 0) // check result, see readme for error codes.
{
Serial.println("failed");
}
MP3player.setVolume(volume, volume);
MP3player.setMonoMode(monoMode);
}
it's very simple code that play audio file from the sd card in the shield, i connect my headphone to the shield and run the program i didn't hear anything and i checked the serial monitor gave me message " Already playing"
I don't know where is the problem
any ideas?