Page 50 - RoboGenius Pro C4
P. 50
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.
RoboGenius Pro - IV
48

