Hello all,
I'm working on a project to make a SD card MP3 player.
I'm currently testing code to try and get a file to play from the SD card module to my 8ohm speaker that is connected to a digital pin (seems to work fine with melody tutorial).
I've already converted the file to .wav and i've run a reading test on the SD card and module and i can read the files on the SD card through arduino so that works ok.
The big problem that i cannot figure out is why I try to play the song it doesn't work.
Help please!!!
#include <pcmConfig.h>
#include <pcmRF.h>
#include <SD.h> // need to include the SD library
#define SD_ChipSelectPin 4 //using digital pin 4 on arduino nano 328
#include <TMRpcm.h> // also need to include this library...
TMRpcm audio; // create an object for use in this sketch
void setup(){
audio.speakerPin = 9; //speaker pin 9
if (!SD.begin(SD_ChipSelectPin)) { // see if the card is present and can be initialized:
return; // don't do anything more if not
}
}
void loop(){
audio.play("here_comes_the_sun.wav"); // play "here comes the sun" by the Beatles
}