This chapter presents how to use sensors with micro: bit to sense the physical environment. It has some built-in sensors such as accelerometers, compasses, temperatures, lights, and touch. You can use them without attaching any external components to your micro:bit.
12-1. Using Built-In Accelerometer
Problem
You want to get the acceleration values in the left and right direction (x-axis).
Solution
In the Toolbox, click on the Basic category. Then click and drag the show number block over, and place it inside the forever block.
In the Toolbox, click on the Input ...