Page 67 - Ai Robogenius
P. 67

You can easily control these lights using MakeCode blocks such as:


                         Name                       Icon                             Description
                   show icon                                          Displays  ready-made  symbols  like
                                          show icon
                                                                      hearts or smiley faces.


                   show string           show string "Hello!"         Scrolls a message or word across the
                                                                      screen.


                   show number                                        Shows any number on display.
                                          show number  0




                   show leds                                          Designs your own shapes or patterns
                                          show leds
                                                                      by turning specific LEDs ON or OFF..


















                      Ask AIRO


                      How can I make the micro:bit’s LEDs show a custom shape using the “show leds” block?




                 Why Are LEDs Important?

                 The LEDs on the micro:bit are very important
                 because they provide quick and clear visual                   SMART            LEDs use less

                 feedback,  making  it easier  to  understand                  SPARK        power compared to
                 what is happening in a program. This makes                                   traditional bulbs.

                 it  more fun  and easier  to  understand  how
                 coding works.

                 For example, if you wanted to show your name on the micro:bit, the LEDs would
                 light up in a pattern that looks like the letters of your name.








                                                                             Playing with Lights and Buttons
                                                                                                                    65
   62   63   64   65   66   67   68   69   70   71   72