I am trying to play wav file using arduino UNO, catalex SD card and 8 ohm speaker
I am using TMRpcm library. My hardware is working fine (i checked separately). My code is compiling correctly but when i upload, the file isn't playing.
On serial monitor the output of --> Serial.println(tmrpcm.isPlaying());
is coming out to be 0
Here is my code-
#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 tmrpcm;
void setup(){
tmrpcm.speakerPin = 9;
Serial.begin(9600);
if (!SD.begin(SD_ChipSelectPin)) {
Serial.println("SD fail");
return;
}
tmrpcm.play("WARRIOR.WAV");
Serial.println(tmrpcm.isPlaying());
}
void loop(){
}