
To practice working with sensors, you can try an easy version that simply
moves the marker all the way left or all the way right. Then move on to the
version that moves the marker different amounts, depending on how far the
micro:bit is tilted. The program isn’t very long, but it involves a new concept
called mapping. Mapping lets you take the numbers that represent what the
accelerometer measures and translate them into different numbers that
tell the servo how far to turn. See the “Accelerometer Basics” box on page
168 for a quick explanation of how it works.
1. Begin by setting the servo in the neutral position:
• Open the Servos menu (see ...