The mission
E-Bhapa, a contest robot built in one night in 2024, is meant to drive up to a wall, back away and turn.
What happened
E-Bhapa, a contest robot built in one night in 2024, re-read line by line in 2026.
It drives into the wall and keeps pushing.
What I believed
The robot turns, backs away from walls and follows at a safe distance, as its README said.
- The motor driver's dead. The motors are fine. They're doing exactly what they're told.
- Front and rear wiring are swapped. Half true: the wiring was wrong. With it fixed, it still won't reverse.
What was true
It never turned and never reversed: both sides averaged to the same speed, and the motor library's speed is a uint8, so −255 became 1. Pinned against a wall 87 % of the time in simulation.
Try it yourself
Loading the diagram. It needs JavaScript; the text around it says the same thing in words.
The fix
The motor library takes speed as an unsigned byte, so every negative speed wrapped to a small positive one. A signed speed plus a direction pin, and the robot reverses, turns and leaves the wall.
Pinned against a wall 87 % of a simulated run, as flashed in 2024.
Evidence: fh1m/E-Bhapa
Keep doing
Read the library's types. The compiler won't argue for you.
Do differently
Simulate the sketch as written, quirks included, before believing the demo.