Pages: [1]   Go Down
Author Topic: Code for random tracks on mp3 trigger?  (Read 961 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've got an Uno with an mp3 trigger (https://www.sparkfun.com/products/11029?) and am trying to program the Uno so that it will randomly play through the tracks on the SDcard.

Can anyone help with this?


Thanks in advance

Dan
Logged

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

According to the MP3 Trigger's user guide, already has a function to play random tracks.  If you use the the sample initialization file all you'd have to do is change the number after #RAND to 0.

However if you want to control everything from the Uno, you could modify this code and incorporate it into your sketch.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks, I'll have a play around!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OK, I'm still at a loss!

I'm trying to get a sketch that will play a random sample from the sd card with a series of delays between each sound. 

As a complete newb I am lost!
Logged

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If these are fixed delays, just add appropriately long delay() or delayMicroseconds() statements as needed (e.g. like adding a second or two of delay between playing songs). 

If there's a more complex behavior desired, you'll have to give a more detailed explanation of what you want to do.
Logged

Pages: [1]   Go Up
Jump to: