Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 66 - Ai Robogenius
P. 66

    You can use the compass sensor in various projects, such as:

                          Navigation  systems  where you  can  track  direction
                         changes.
                          Compass-based games where the Micro:bit reacts to
                         directional changes.

                          Interactive projects that respond when the device faces
                         specific directions, like pointing to a goal in a maze.

                      The compass sensor is a great way to explore how real-world navigation systems
                      work.

                            Ask AIRO

                           How can I use conditional logic to change the displayed icon based on the value of the
                           accelerometer?

                      SHAKE TO CHANGE THE DISPLAY ICON

                      The goal of this activity is to create a program that changes the display icon on
                      the Micro:bit when it is shaken. The icons will cycle through three different states:
                      Happy, Sad and Surprised. The program will track the current icon state using a

                      variable and update the icon each time the Micro:bit is shaken.

                      Let’s get started with the project. Follow these steps to set up your project.

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

                        STEP - 2   Click on the New Project button.

                                     AI RoboGenius - IV
                     64

| 61 62 63 64 65 66 67 68 69 70 71 |