VMM501
V. 01 – 17/01/2019
22
©Velleman nv
Have a look at the code below.
1.
Drag and drop the code blocks to form the code as shown.
You can find the
forever
and
pause (ms)
100
in
Basic
in the Code
Drawer. You can find the
ring tone (Hz)
block in
Music
in the Code
Drawer.
2.
Set the first
ring tone (Hz)
to
middle C
. To do so, click the text box and
select the corresponding piano key.
You will also hear the corresponding tone.
3.
Set the
pause
to 100 ms.
4.
Do so for the rest of the ring tones and pauses.
5.
When complete, we compile the programme and generate a hex. file. Click
on the download button and save the hex. file to the Downloads folder
C:\downloads. This hex. file is ready to upload to the micro:bit.
Plug the micro:bit into a USB port. The, drag and drop the hex. file onto the
micro:bit removable device to upload the programme.
We can hear a sound from the buzzer. Now, how would you programme your favourite nursery rhyme?