About 80% of the coding was done by Primo himself; I only provided some guidance on how to use a switch statement as a state machine (which was easier than trying to explain how to use indexed state tables).
In this case I also had Primo do the Fritzing and put the circuit together himself, which involved a few lessons on short circuits, but he got it working.
Here is the video, breadboard, schematic, PCB, and source code for your enjoyment.
NOTE: The actual sensor is a PING))) by Parallax; we just couldn’t find the correct picture and have not figured out how to create one yet.
Source Code: Flush