Finite State Machines

Each task in our main program is implemented as a finite state machine (FSM), structured using a switch-case statement within a while loop. At any given time, an FSM resides in a specific state, executing its corresponding task. Since the main program can only be in one state and execute one task at a time, scheduler priorities and periods are carefully optimized to run as efficiently as possible. The FSMs are implemented in the following tasks:

Motor FSM

Motor FSM

Comms FSM

Comms FSM

Collect FSM

Collect FSM

IR Sensor FSM

IR Sense FSM

Motor Control FSM

Motor Control FSM