Page 59 - Robo_Genius_V1.0_flipbook_C3
P. 59

Understanding Sequencing and Timing


                 The micro:bit LED display consists of a 5 × 5 grid of LEDs that can be individually
                 controlled to create images and animations.

                 In  this  activity,  the  display  is used  to  show  a  beating  heart  animation  by
                 alternating between two images: a large heart and a small heart.




























                 Image Display: The heart images are shown by lighting up specific LEDs in a
                 5x5 grid. Different patterns of LEDs create the large and small heart shapes.





























                 Timing and Sequencing: The program switches between the heart images every

                 half second, controlled by a timer to keep the images changing at a steady rate.
                 Looping: An infinite loop in the program repeatedly shows the heart images in

                 sequence, making the heart animation appear to beat continuously.




                                                                                 Programming with Micro:bit   57
   54   55   56   57   58   59   60   61   62   63   64