I am struggling with C coding and could really use some help. I am trying to make a MP3/WAV file player that plays a random file (50 total file options named 01-50) for 8 seconds when a push button is pressed. Once the file is finished playing the Arduino stops and waits for the button to be pressed again. If the button is pressed before 8 seconds finishes, the Arduino skips to the next random file. I don't need any volume control or any complex error return message code. Just as basic and simple as you can code it.
I have an Uno and a MP3 shield all set up and working. I am getting success working through Arduino tutorials on getting the player to output the files, however I am not having any luck at all with the random number generator function. If anyone could please help me with the code I would greatly appreciate it.
REASONING: My 3 year old nephew is OBSESSED with alarms (fire alarms, ambulance sirens, smoke detectors, etc.) and he always tries to point them out and let us know which one is which. I have 50 different alarm .WAV files that I want to let him quiz himself on every time he presses this button. He will absolutely love sitting there for minutes (that is a lifetime to a 3 year old) cycling through these alarms. Aaaaaaand I also want to drive his parents crazy!!