Components and supplies
Mini breadboard
Trim Potentiometer
Jumper wires (generic)
Resistor 10k ohm
Arduino UNO
Male/Female Jumper Wires
I used an old Tjena box but any box will do
LDR, 5 Mohm
Buzzer, Piezo
ESD Tape, Masking
Apps and platforms
Arduino IDE
Project description
Code
LightSensingBuzzer
arduino
Firstly, take a look at the section of code from about lines 30 through to 59. This section determines what tune will be played and at what speed (via tempo value). The current tune has a total of 19 notes and rests. This is the value of songLength (line 31). You must edit this value to match the number of notes/rests in your tune. Edit the song length on line 29 to reflect the number of notes in your song. Include all the notes and rests in the count. Follow the commented instructions in the code when editing the notes and the beats array. You'll need some understanding of how musical compositions work to code your own tune. You can expect to spend some time getting the timing of the notes correct. Speed up or slow down the tune by changing the Tempo value on line 29.
LightSensingBuzzer
arduino
Firstly, take a look at the section of code from about lines 30 through to 59. This section determines what tune will be played and at what speed (via tempo value). The current tune has a total of 19 notes and rests. This is the value of songLength (line 31). You must edit this value to match the number of notes/rests in your tune. Edit the song length on line 29 to reflect the number of notes in your song. Include all the notes and rests in the count. Follow the commented instructions in the code when editing the notes and the beats array. You'll need some understanding of how musical compositions work to code your own tune. You can expect to spend some time getting the timing of the notes correct. Speed up or slow down the tune by changing the Tempo value on line 29.
Downloadable files
Musical Treasure Box Circuit
This circuit has an LDR to sense the light level in the environment and a buzzer to play a tune. The potentiometer is included to encourage others to consider doing an extension of the project but is not used in this project. It can be left out if desired by removing the potentiometer and the three wires connected to it.
Musical Treasure Box Circuit
Comments
Only logged in users can leave comments
joannehadley4
0 Followers
•0 Projects
Table of contents
Intro
2
0