Hi there -
I searched for "random players" and found more than a few examples - but I'm specifically interested in how one would make sure a random player started randomly, each time... I had some trouble finding this.
My current code is essentially the same as Michael P. Flaga's... it reads as follows. Can someone help me?
// libraries
#include <SPI.h>
#include <SdFat.h>
#include <SdFatUtil.h>
#include <SFEMP3Shield.h>
// initialize MP3 card
SdFat sd;
SFEMP3Shield MP3player;
byte result;
// setup
void setup() {
result = sd.begin(SD_SEL, SPI_FULL_SPEED);
result = MP3player.begin();
MP3player.setVolume(12, 12);
randomSeed (millis());
}
// loop
void loop() {
MP3player.playTrack(random(5)); // range of tracks to randomly play.
while (MP3player.isPlaying());
MP3player.stopTrack();// stop track
}