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.
- Jump down to the Radio Tilt Controlled cyber:bot App at the end of this tutorial.
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 Micro B cables
- One or more computers with:
- Access to python.microbit.org on a Chrome browser
Complete these lessons first from the 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
Curriculum
- 1 Section
- 37 Lessons
- Lifetime
Expand all sectionsCollapse all sections
- Cybersecurity: Radio Tilt Control37
- 1.1Measure Accelerometer Tilt
- 1.2Test Tilts
- 1.3A Bit About Acceleration
- 1.4Inside the micro:bit Accelerometer
- 1.5How the Script Works
- 1.6Try This: Take X and Y Rotation Samples
- 1.7Your Turn: Combine Tilt and Rotation
- 1.8Measure Rotation Angles
- 1.9Measuring Rotation Angles
- 1.10How Measuring Rotation Angles Works
- 1.11Did You Know? Trigonometry and Rotation Angles
- 1.12Measure How Far from Vertical or Level
- 1.13How It Works
- 1.14Z-Axis: Which Way Is Up?
- 1.15How it Works: Z axis
- 1.16Did You Know? This Way Up
- 1.17Try This: Get Familiar Z-Axis Angle Measurements
- 1.18Your Turn: All Together Now
- 1.19Display Tilt Direction
- 1.20Try This: Negative Hour Values
- 1.21Your Turn: Display Tilt Direction
- 1.22Tilt Radio Tests
- 1.23Radio-Transmit Tilt
- 1.24Radio-Receive Tilt
- 1.25How the Tilt Radio Tests Work
- 1.26Tilt Control Forward and Backward
- 1.27Rapid Radio-Transmit Tilt Data
- 1.28Rapid Radio-Receive Tilt Plus Forward/Backward Control
- 1.29Adding a Stop Range
- 1.30Transmitter Displays Stop Range
- 1.31Receiver Full Tilt Control and Stop Range
- 1.32Add Left/Right Tilt Control
- 1.33Update the Receiver cyber:bot Script
- 1.34How the Receiver Works
- 1.35Radio Tilt Controlled cyber:bot App
- 1.36Radio Tilt Controlled cyber:bot Code
- 1.37Radio Tilt Controller Code