A functional traffic light and crosswalk simulation using only state machines.
I'm working on using state machines as a visual complement to code for expressing logic. The lights loop through the regular green, orange, red cycle until the cross walk button is pressed. Then they wait for the next complete cycle to red to enable the cross walk sequence before returning to green and continuing as normal.
State machines work great for describing moderately complex systems as they are explicitly defined (no more forgetting to update a specific variable), cleanly visualised and easily expanded with new functionality (the additional logic to cycle more quickly to red once the crosswalk button is pressed was just one extra transition from the Go to Wait states).