Data Sheet

39 : circuit 2a
PROGRAM OVERVIEW
1
Play the first note for x number of beats using the play() function.
A: (Inside the play() function): Take the note passed to the play function and compare it to
each letter in the notes array. When you find a note that matches, remember the index
position of that note (e.g., sixth entry in the notes array).
B: Get a frequency from the frequency array that has the same index as the note that matched
(e.g., the sixth frequency).
C: Play that frequency for the number of beats passed to the play() function.
2
Play the second note using the play() function
...and so on.
WHAT YOU
SHOULD SEE
When the program begins, a song will
play from the buzzer once. To replay
the song, press the reset button on the
RedBoard. Use the potentiometer to
adjust the volume.
Open the Arduino IDE
Connect the RedBoard to a USB port on your computer.
Open the Sketch:
File > Examples > SIK_Guide_Code-V_4 > SIK_CIRCUIT_2A-BUZZER
Select UPLOAD to program the sketch on the RedBoard.