The basic circuitry can be reused in a number of costume ideas:
To use your own remote and differentiate buttons:
- For the December holidays, a seasonal tune may accompany a blue light for Hanukkah or a twinkling star for the top of a Christmas tree.
- The electronics fits easily fits in a moderate or larger size hat.
To use your own remote and differentiate buttons:
- Ensure the serial commands are printing to the Arduino IDE serial console.
- When a sound is playing and you press a button, the hexadecimal number for the key press will be displayed.
- Write that down. Find the others you want the same way.
- Generate code similar to that below (assuming the two hex values represent the codes you wrote down earlier):
char track_name[13]; ... if(results.value == 0xDEADBEEF) { // code was found to be the "1" key track_name="track001.mp3"; } else if(results.value == 0xFEED1234) { // code was found to be the "2" key track_name="track002.mp3"; }
Your key values will vary. These codes are examples only and do not match any particular remote.
Then to play the correct file, replace
Then to play the correct file, replace
musicPlayer.startPlayingFile("track001.mp3") with musicPlayer.startPlayingFile(track_name)
If you want to simplify the project, you can remove the Neopixel and code and/or remove the IR receiver and code. If you do not have a way to mute the sound, it could be annoying after a while listening to the same tune.
Text editor powered by tinymce.