Page 80 - Robo_Genius_V1.0_flipbook_C5
P. 80

• Block-based programming is an enjoyable approach to learn programming
                     and bring the micro:bit to life since it allows you to see the results of their

                     code quickly.



                                                                                                 21 st
                                   Writing a Program to                                       Century   #Technology Literacy
                    Activity                                                                    Skills
                                   Display Emotion Badges


                  Overview


                  In this activity, you will make an emotion badge using the micro:bit. You will
                  program the micro:bit to show different faces, like happy, sad, or surprised,
                  on its LED display. This activity will help you to understand how the micro:bit’s

                  buttons work and how you can use them to control what happens on the screen.

                  The Micro:bit has many different parts, and one of them is its programmable
                  buttons. On the front of the micro:bit, there are two buttons, called Button

                  A  and  Button  B.  By  pressing  these  buttons,  you  can  make  the  micro:bit  do
                  different things. For example, you can use them to change what shows on the
                  screen or to control other actions in your projects.










                             Button A                                                           Button B












                  Algorithm Used
                                                                                              On Button A Pressed:
                  An algorithm is a step-by-step procedure that defines
                                                                                                 Show Smile icon
                  a  set  of  instructions that  must  be  carried  out  in  a
                                                                                              On Button B Pressed:
                  specific order to produce the desired result.
                                                                                                 Show Sad icon
                  Source Code

                  Step 1        Go to Microsoft make code https://makecode.microbit.org/




                       78    RoboGenius (V1.0)-V
   75   76   77   78   79   80   81   82   83   84   85