Projects with Python·Tutorial 7 of 7

Obstacle Avoider in Python

Advanced

Program your robot to navigate a room on its own in Python. It drives forward until the distance sensor detects an obstacle, then reverses and turns to find a clear path.

40 min5 steps
DistanceToFMotorsAutonomousRobotPythonProjectAdvanced
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 time-of-flight distance sensor faces forward. Place the robot on the floor in an open area before running.

Clear the floor of obstacles you don't want the robot to hit. The robot will move autonomously — make sure there are no drop-offs nearby.