Professional Documents
Culture Documents
Project 02 Playing Music
Project 02 Playing Music
Project 02 Playing Music
1. Introduction:
We can use Arduino to make many interactive works, of which the most
2. Passive Buzzer:
www.kidsbits.cc
kidsbits
3. Advantages:
Low cost
jointly.
cycles (a signal that constantly switches between high and low levels) to
control the analog output.In general, the input voltages of ports are 0V
and 5V.
www.kidsbits.cc
kidsbits
In the above figure, the green line represents a period, and value of
duration in a cycle. From top to bottom, the duty cycle of first square
lowest, that is, light off. The more time the high level lasts, the brighter
the LED.
Therefore, the last duty cycle is 100%, which correspond to 255, and LED
is the brightest. And 25% means darker. PWM mostly is used for
www.kidsbits.cc
kidsbits
Beats are the time delay for each note. The larger the number, the
longer the delay time. A note without a line in the spectrum is a beat,
of a beat without a line, and a beat with two underlines is 1/4 of a beat
without a line.
5. Preparation:
(1) Slide the Bluetooth switch under the yellow robot to OFF end
(2) Interface the yellow robot with a computer via a USB cable.
6. Test Code1:
You can drag blocks to edit. Blocks listed below are for your reference
(1)
www.kidsbits.cc
kidsbits
(2)
(3)
(4)
Complete Program
www.kidsbits.cc
kidsbits
7. Project Result1
Slide the Bluetooth switch to OFF end, click to upload the code
to the yellow robot successfully, you will hear the sound of“do re mi fa
so la si”
8. Test Code2:
You can drag blocks to edit. Blocks listed below are for your reference
(5)
(6)
(7)
www.kidsbits.cc
kidsbits
(8)
Complete Program
9. Project Result2
Slide the Bluetooth switch to OFF end, click to upload the code
to the yellow robot successfully, you will hear the Ode to Joy song.
www.kidsbits.cc