For this small project I am only trying to play loop of a song. I have simple code using the SD card library and the PCM library. The code compiles and uploads to the Arduino but not before displaying
In function 'void setup()':
ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
tmrpcm.play("1.wav");
^
Then, even though the code compiles and uploads to the board, the music doesn't play.
If your SD card does not initialize properly in the SD.begin() call, you simply return from setup() which then goes into loop() forever. It would be much better to
Thank you, changing the baud rate finally caused it to display something useful. Unfortunately it is failing to initialize the SD card. How would one go about fixing that because my SD card reader module does not have labelled pins? Though they seem to be in the normal spots as I am still getting power delivery to the module.
It really depends on what SD module you are using. It should document where the CS pin maps to. A common one is pin 10 but trying random pins seems like the wrong way to solve this problem.
If you look at the cardInfo example sketch that comes with the SD library:
// change this to match your SD shield or module;
// Arduino Ethernet shield: pin 4
// Adafruit SD shields and modules: pin 10
// Sparkfun SD shield: pin 8
// MKRZero SD: SDCARD_SS_PIN
Unfortunately there is nothing printed onto the card itself so I am going to see if I can find a different module tomorrow. I will come back to this project once I have a different module. Thank you so much for your help!
Thank you so much, it finally recognizes the card I was apparently one pin off even though I swear I have looked at it several times. It won't play the file, it reads "playing file" on the original code but doesn't play the file so I will look into that and let you know.
I was using a bad SD card because I switched it and now the audio plays. There is added noise and the audio is playing in slow motion but it works. Thank you so much for the help!!