I developed this project with one other co-instructor for the Jr. DEEP summer camp in 2025.
Behaviour#
Source codetext
The robot drives forward while checking distance with an ultrasonic sensor. When something is closer than a threshold, it stops, turns, re-checks, and carries on.
The stopping distance is 10 cm, and the turning times were chosen experimentally based on how quickly the motors can turn, and measuring in 90 degree intervals.
What I learned
- Real sensors are noisy, so one bad reading shouldn't make the robot turn
- Motors don't spin at matching speeds, so "drive straight" needs tuning