I am attempting to make a motion activated .WAV player using an Arduino Uno. I am using a TMRpcm program to play the .WAV file and have a SD card reader module connected to the Arduino's 5V supply. The .WAV file is 16000 Hz 8 bit mono. The program has no actual errors present during compiling or uploading, only the "deprecated conversion from string constant to 'char*' ". When attempting to play the file I got the println text telling me that there was no file. I tested the SD card reader by uploading a program that would read and open a .TXT file which proved the SD card reader is functional, I also tested the two 4 Ohm speakers and they also work. When using an audio player program, the middle two pre-installed LEDs faintly glow red before the led on the right glows red. I will leave a copy of the program below for you to examine. Is there anything that could be suggested that might be causing this problem from what I have described so far? Any answers and/or suggestions would be greatly appreciated and I will be posting the program for more insight on the issue. Thanks.
THE PROGRAM:
#include <SD.h> // need to include the SD library
//#define SD_ChipSelectPin 53 //example uses hardware SS pin 53 on Mega2560
#define SD_ChipSelectPin 4 //using digital pin 4 on arduino nano 328, can use other pins
#include <TMRpcm.h> // also need to include this library...
#include <SPI.h>
TMRpcm tmrpcm; // create an object for use in this sketch
void setup(){
tmrpcm.speakerPin = 9; //5,6,11 or 46 on Mega, 9 on Uno, Nano, etc
Serial.begin(9600);
if (!SD.begin(SD_ChipSelectPin)) { // see if the card is present and can be initialized:
Serial.println("SD fail");
return; // don't do anything more if not
}
tmrpcm.play("jugg.wav"); //the sound file "jugg" will play each time the arduino powers up, or is reset
}
void loop(){
if(Serial.available()){
if(Serial.read() == 'p'){ //send the letter p over the serial monitor to start playback
tmrpcm.play("jugg.wav");
}
}
}