State machines are a brilliant tool, and turn up more often than you expect once you have the background and experience to see them.
Some time ago I wrote up a particularly simple but elegant example I came across. The write-up is here:
https://www.solipsys.co.uk/new/StateMachineInRealLife.html?v...
In case people would like to discuss that specifically, I've (re-)submitted it here: