#include // &&&&&&&&&& Add your well commented and neatly indented code here // It might make sense to have some "#defines" etc... //********************************************************************* void main(void) { volatile int count, myState; // &&&&&&&&&& Add your well commented and neatly indented code here // Initialize Watchdog timer, I/O ports... myState = ???; //Initialize state count = 0; //Initialize count while (1) { //Do this forever count = count + 1; //Increment counter. //************************************************************** //Code for state transitions. This code only figures out what //state transitions to make, and then makes them. switch (myState) { // &&&&&&&&&& Add your well commented and neatly indented code here // Don't forget "default case" } //************************************************************** //Code for state outputs. This just decides on system outputs //based on the current state and inputs to system. switch (myState) { // &&&&&&&&&& Add your well commented and neatly indented code here // Don't forget "default case" } } }