Goal: To play the notes "c-d-e-f-g-a-b-c".
This lesson will help you use the buzzer to make musical notes. Before you start, make sure that the buzzer is activated with knob for the buzzer is in the right position.
Click on the "Buzzer" block in the action bar.
A block will appear on the screen as below.
The block takes three parameters -
1) Note - Also referred as the pitch of the sound. This sets the frequency of the sound. By clicking on the red triangle button on the right of the block, user can select from 8 available frequencies (c, d, e, f, g, a, b, C). These are similar to the notes available in music.
Select "c" for the first block.
2) Beat - This parameter sets the basic unit of time. For example, a note with beat "2" plays for a longer time than a note with a beat "1". Click on the red triangle button to get a number window pop-up. Select "#" to give a constant number as input.
Enter 1.
3) Tempo - This sets the speed or pace of a given piece of music. So, if its a piece of music, its ideal to have the same tempo for all the notes. For the current task, set the value to a constant number "300".
Repeat the same steps for the notes d-e-f-g-a-b-C. Complete program is shown below.
Activity: Modify the obstacle sensor program, so that the robot sounds an alarm sound when it encounters an obstacle.