Code Overview

We implemented our strategy using a state chart. The master state machine is responsible for starting the robot at the flash, and stopping it once two minutes elapses. The game playing state machine deals with finding and getting the flags, keeping track of how many flags have been captured, and going to the goal zone when three flags have been captured or time is running out. There is a separate state machine for going to the goal because of its complexity. This state machine guides the robot in the rough direction of the goal, and then lines it up more precisely once the robot had hit the goal zone paint.

The low level functions of our robot are handled by different software modules. Each state machine also has its own module. These modules are listed below, with links to the module page. You can also download a zip of all of the E128 code here, and the C32 code here.

main Module
Runs the module init functions and loops forever running the Master State Machine.
events Module
Deals with identifying events.
master_sm Module
The Master State Machine.
playing_sm Module
The Playing State Machine, a sub state machine of the Master.
goalfinding_sm Module
The Goal Finding State Machine, a sub state machine of the Master.
beacons Module
Deals with all beacon sensing functionality.
motors Module
Deals with all motor driving functionality.
tape Module
Deals with all tape sensing functionality.
timer Module
An all purpose timer module.
debug Module
Module that controls the debug LEDs.
C32 main Module
The main module of the C32, which displays on the debugging LEDs the number passed via SPI from the E128.