Example Code for micro:bit-Quick Start for Line Tracing
Last revision 2025/12/19
This guide walks you through setting up a micro:bit and Maqueen V5 robot car for line tracing, including hardware and software preparations, wiring, and example code for quick functionality.
Hardware Preparation
- Maqueen V5 Robot Car: 1 (Purchase Link: https://www.dfrobot.com/product-2937.html)
- micro:bit Mainboard: 1
- 3 AA Batteries: 1 set
- Line Tracing Map: 1
Software Preparation
- MakeCode Platform: https://makecode.microbit.org/
- Maqueen Library: Load via MakeCode Extensions (search for "dfrobot" and select "Maqueen")
Other Preparation Work
- Ensure the micro:bit mainboard is properly plugged into Maqueen V5.
- Install the batteries correctly.
- Turn on the power switch.
- Place the car on the line tracing map.
Sample Code
Example 1: Quick Line Tracing
Program Description:
- Quickly enable the line tracing function.
- After downloading the program and placing the car on the accompanying map, the car will automatically follow the black line to travel, as shown in the figure:


Result
- The car automatically follows the black line on the map.
Was this article helpful?
