Page 63 - Ai Robogenius
P. 63

STEP - 6   Drag the show number block from the Basic category and place it inside
                               the on button A pressed block.



                                                         on  button   A  pressed

                                                           show number  0



                                                                                         on  button   A  pressed
                   STEP - 7   Drag the temperature block from the Input
                               category and place it inside the 0 of the show              show number temperature (°C)
                               number block.

                               Your block-based code should now look like this.


























                  STEP - 8   Click on Start the simulator button to run the program.


                 Output

                 When you press Button A on the Micro:bit, the current
                 temperature  appears  on  the  LED display.  As  the

                 temperature around the Micro:bit changes, pressing
                 the button again  shows a different reading, helping
                 you  to  see  how the  sensor  reacts  to  environmental

                 changes.



                  ECOTECH       Micro:bit uses very little electricity and small materials, so it is gentle on the
                  ENERGY        environment. You can reuse it for many projects, which helps reduce waste.









                                                                          Micro:Bit and the World Around Us
                                                                                                                    61
   58   59   60   61   62   63   64   65   66   67   68