Page 38 - RoboGenius Pro C5
P. 38
Your block-based code should now look like this.
STEP - 9 Click on Start the simulator button to run the program.
Output
When the program runs, the
Micro:bit plays the ringtone sound
continuously through the buzzer.
At the same time, the LED display
keeps changing between two icons
every second. This shows how the
Micro:bit can control output devices
like buzzers and LEDs together
to make interactive and creative
projects.
You can also add more blocks to
make the ringtone play a set number
of times or trigger it when a button is pressed, depending on your preference.
CHALLENGE CHAIN
You are working on a project using a micro:bit and want to add sound to it. You decide
to attach a speaker. Which pins will you use to connect the speaker to the micro:bit?
RoboGenius Pro - V
36

