Line Sensor in Python

Intermediate

Read the left and right TCRT5000 line sensors using `pybot.line_left()` and `pybot.line_right()`. Combine boolean readings to detect where a dark line is relative to the robot.

20 min5 steps
Line SensorTCRT5000BooleanSensorIntermediate
0 of 5 steps

Step 1 of 5

Connect your board

Power on your Beaver Board — the OLED will show a PIN code. Click Connect in the toolbar, choose Connect via Bluetooth, and select your board. If it's your first time, enter the PIN shown on the screen.

The TCRT5000 sensors point downward from the board: left on GP4, right on GP5. No extra wiring needed.