What it’s about
Control a cyber:bot by tilting a micro:bit! The controller micro:bit measures tilt with its accelerometer, and sends that information to the cyber:bot with its radio. The cyber:bot receives the radio-transmitted tilt data and uses it to set its wheel speeds.
This tutorial can be approached in two ways:
I just want to tilt-control my cyber:bot!
- Check the Before you start list below to make sure you are ready.
- Do the Radio Tilt Tests section to make sure your controller micro:bit and receiver cyber:bot are communicating data properly.
I want to learn about developing this kind of app and how an accelerometer works, or I’m in a class and it’s required:
- Check the Before you start list below to make sure you are ready.
- Go through the activities sequentially to learn about accelerometer sensing, tilt angle calculations, radio tests, forward/backward control, add stop range, left right control, and adding exception handling.
Before you start
You will need:
- A fully built and tested cyber:bot robot
- One additional micro:bit module (on or off a cyber:bot)
- Two USB A to MicroB cables
- One or more computers with:
- Access to makecode.microbit.org on a browser
- Access to Google Chrome Labs Serial Terminal on a browser
Complete these lessons first from the Change this link cyber:bot Tutorial Series:
- Required
- Recommended
After you finish
If you go through the tutorials sequentially, you will gain experience with:
- How an accelerometer works
- How sensing axes can be more or less aligned with gravity
- How a capacitive accelerometer detects acceleration and gravity forces
- Trigonometry tricks for calculating tilt angle from accelerometer measurements
- Scaling sensor values for speed/direction control
- Incremental maneuver feature addition
- Using key-value pairs to simplify data exchange between devices in a cyber:bot app. This was introduced in Cybersecurity: Radio Data