Here is another state machine tutorial with examples and also appears to be well received.
http://forum.arduino.cc/index.php?topic=505805.0
Here is another state machine tutorial with examples and also appears to be well received.
http://forum.arduino.cc/index.php?topic=505805.0