Page 57 - Ai Robogenius
P. 57

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?
















                                                                          Micro:Bit and the World Around Us
                                                                                                                    55
   52   53   54   55   56   57   58   59   60   61   62