When the button is pressed it activates the function that we tied to the button in setup.
In the end the premise and end result still amuse me so, mission accomplished I guess.
Now is the point in this step where I proceed to ramble about the inner workings of the sketch.With the libraries out of the way the music player itself is initiated and our global variables are declared.Before you start in on the code you need to do a little legwork with the music.Finally the file extension,.mp3, is slapped on the end and the whole thing is written to a character array.This eclectic series features the work of well-known innovators in contemporary music, but a large percentage of the Series is devoted to emerging artists and composers.While the number of clubs and mainstream concerts halls in New York is considerable, Roulette is unique in its persistent commitment to new, experimental work and the artists who make.Roulettes Concert Series for New Adventurous Music, launched in 1978, presents a wide range of experimental music including avant-jazz, new bonus information letter music, opera, world music, and electronic.Roulette is a major New York City venue for contemporary music and intermedia art, internationally recognized for the presentation and promotion of experimental contemporary music, an incubator for young talent and a laboratory where new ideas and new technologies are examined, appraised and developed.TachDigitOperation(3, randomSong, high randomSeed(analogRead(4 Any time a song is chosen the code must build the file name of the song in three steps.If you want a little more style though you can easily attach a different style switch, in my case a push button with a big red switch cover.Then a quick hole in the middle of the front panel and we're ready to add the switch, and optional cover.Meaning the button has no effect and it randomly shuffles through all 100 songs not just the first.
Plug it back into the computers USB (externally powered or not) and reset and it's suddenly working fine again.
If (switched LOW) playingState PS_stop;.
You need the Arduino code to be able to construct the full path of your songs on a random basis.
Wav switched LOW; The randomSong function begins with simple form of debounce that probably isn't really necessary and then moves to check if the button is unlocked.
Thank you for spending your valuable time reading this.
This is a pretty hardware light build since the MP3 shield contains almost everything we need.With the pin out of the way the hot wire from your switch can be plugged into the space it vacated.String base "0 trackNum random(1, 76 ncat(trackNum 3 CharArray(title,9 Now we enter our main loop and begin by setting the player to normal mode and beginning playback of the first song.Conclusion If I'm honest, overall I'm a little disappointed in the presentation of the final product but I'm proud of the code and it's simplicity (although I know there are a couple of optimizations I chose to leave on the table due to time).Fortunately the rest of the board and chip seems to have survived allowing my next project to continue.As stated earlier, the documentation and libraries for the v1 Seeedstudio music shield are a bit shoddy and under supported.