Page 39 - RoboGenius Pro C4
P. 39

Final Output

                 You will see Hello displayed on the Micro:bit’s screen, just like in the simulator.














                                                       CHALLENGE CHAIN
                  Write the code in MakeCode that will generate a random number between 1 and 6

                  when button A is pressed. After showing the number, make the micro:bit display the
                  number as a word (e.g., One for 1, Two for 2, etc.) for 2 seconds.










                 BUILD A LIGHT BLINKING PROJECT

                 Let us create something fun, a light blinking project. In this project, you will control
                 a light and make it blink on and off in a specific order. This will help you practice all

                 the concepts you have learned about sequencing, timing and order of commands.
                 Make a light blink in a repeating pattern using the instructions in correct order.

                 To build a light blinking project, perform the given steps:

                   STEP - 1   Visit the link: https://makecode.microbit.org/ or scan the QR Code.

                  STEP - 2   Click on the New Project button.



























                                                                                     Coding with Micro:Bit
                                                                                                                    37
   34   35   36   37   38   39   40   41   42   43   44