I am using an Arduino Nano in combination with a SD card to play some music. I have loaded some .wav files on my SD card, the card initializes, everything runs correctly, but on my output pin for my music I get an unstable square wave signal all the time.
I have tried to change the CS pin to pin 4 and 10 (only pin 4 works), I have tried different .wav files and a bunch of code and all of my libraries are installed. What can I do?
#include <SPI.h>
#include <SD.h>
#include <TMRpcm.h>
TMRpcm audio;
void setup() {
audio.speakerPin = 9;
//starting up SD
Serial.begin(9600);
if (!SD.begin(4)) {
Serial.println("Initialization failed");
while (true) {
}
}
Serial.println("Initialization complete");
audio.setVolume(3);
audio.play("SSTC.wav");
}
void loop() {
}