The State Machine
The state machine for our SumoSenator Robot was very simple, incorporating only 4 different states. The main strategy was to search for the 850 Hz beacon and once it was found, drive to it. If the 850 Hz beacon was lost at any point while driving forward, the robot returned to the searching state. If at any point black tape was sensed, the robot would reverse its direction for a set period of time and then return to the searching state. If the robot ever sensed the 850 Hz beacon and black tape, the robot had to be close to the edge and close to pushing the brick off the edge and would continue to drive forward for a glorious victory over the brick.
Final Implementation
Software is never written in a single sitting, and version one is never perfect. In keeping with this tradition we went through several versions of the state machine before the night of the competition. Included below is the final versions of the state machine that were on board when we beat the brick and then for the night of the competition.
Beating the Brick Code | |
File Size: | 12 kb |
File Type: | ino |
Competition Code | |
File Size: | 14 kb |
File Type: | ino |