Skip to main content

Case 02: Line-following Cars

Purpose


To make a line following car.


micro:bit Wonder Building Kit

Materials Required


Video link: https://youtu.be/J2QKDKnTklw

Bricks build-up


Installation Mthods of Hardwares

Install the dual-line tracking sensor with the bricks.

Hardware Connection

Connect two motors to M1 and M2, the dual line-following sensor to P1 and P2 ports on Wukong breakout board.

Software Platform


MakeCode

Coding


Add extensions

Click "Advanced" in the MakeCode to see more choices.

Search with Wukong in the dialogue box to download it.

Program

Link:https://makecode.microbit.org/_RXCL9zU1pW5m

Result

The car moves along with the maps at a uniform speed, it will keep its speed and directions if it deviates from the black line until it goes back.