Example Code for micro:bit-Line-tracking
- Learning Target: Let the car run along the black line. - Effect: Maqueen drives along the black line on the map. If you don’t have a map, you can make one using black adhesive tape.
Hardware Preparation
- Maqueen Lite-micro:bit Educational Programming Robot Platform x 1 (ROB0148)
- micro:bit board x 1
- Black adhesive tape (for making a line map)
Software Preparation
- Makecode graphical online programming platform: makecode.microbit.org
- Maqueen library: Search for "dfrobot" in makecode extension and select "maqueen".
Wiring Diagram
No additional wiring required. The line-tracking sensor is integrated with Maqueen.
Other Preparation Work
Calibrate the line-tracking sensor if necessary (refer to the Reference section for calibration steps).
Sample Code
Screenshot of Makecode Graphical Program:

Makecode Program Link: https://makecode.microbit.org/_4rACHK3e2eeX
Result

Additional Information
No additional content provided.
Was this article helpful?
