src/StateMachine.cpp
/*
 * Main execution of the machine occurs here in run
 * The current state is executed and it's transitions are evaluated
 * to determine the next state. 
 * 
 * By design, only one state is executed in one loop() cycle.
 */
Main execution of the machine occurs here in run
The current state is executed and it's transitions are evaluated
to determine the next state.

By design, only one state is executed in one loop() cycle.
Main execution of the machine occurs here in run The current state is executed and it ' s transitions are evaluated to determine the next state . By design only one state is executed in one loop () cycle .
void StateMachine::run(){
  if(stateList->size() == 0) return;
  if(currentState == -1){
    currentState = 0;
  }
  int initialState = currentState;
  int next = stateList->get(currentState)->execute();
  if(initialState == currentState){
    executeOnce = (currentState == next)?false:true;
    currentState = next;
  }
}
void StateMachine :: run ( ) { if ( stateList -> size ( ) == 0 ) return ; if ( currentState == -1 ) { currentState = 0 ; } int initialState = currentState ; int next = stateList -> get ( currentState ) -> execute ( ) ; if ( initialState == currentState ) { executeOnce = ( currentState == next ) ? false : true ; currentState = next ; } }
Main execution of the machine occurs here in run
 The current state is executed and it's transitions are evaluated
 to determine the next state.
Main execution of the machine occurs here in run The current state is executed and it ' s transitions are evaluated to determine the next state .
//Serial.println("StateMachine::run()"); // Early exit, no states are defined // Initial condition // Execute state logic and return transitioned // to state number. Remember the current state then check // if it wasnt't changed in state logic. If it was, we  // should ignore predefined transitions.