The project I’m trying to develop is quite simple, I have an SD shield and card containing twenty audio files and a pushbutton. Every time the button is pushed, it generates a random number and uses that to play one of the files at random. The problem I am having is that pushing the button it prints several lines to the serial and no sound is played. The SD card is recognized and read, individual sounds can be played and the push button works but it can get stuck in a loop. Is there something wrong with my code?
randomNumber.ino (1.87 KB)