4.Line Following

Welcome back to our series of BocoBot Car lessons! In this lesson, we are going to equip your car with the fascinating ability to follow a line on a track. Imagine watching your car smoothly navigate a predefined route!

 

 

Installing the Maker Line

The key component in giving your car this new skill is a sensor called the Maker Line. This sensor enables your car to detect and follow black lines on its path. 

 

To get started, connect the Maker Line to Grove Port 5 on your Bocobot Car. If you're unsure about how to make this connection, we've got your back. The connection diagram below will walk you through the process.

Setting Up the Software

We will need a new script from our Github repository to give your car its line following abilities. If you haven't yet downloaded the files or need to re-download them, you can do so here.

 

Next, copy the content of the '04_Line_Following.py' file and paste it into the 'code.py' file on your Raspberry Pi Pico W. 

 

The '04_Line_Following.py' script is the roadmap for your Bocobot Car. It instructs the car to use the Maker Line sensor to detect any line on the track and faithfully follow it.
 

Hardware Components