State Machines

I imagine PaulS means to name the states in a meaningful way, like:

BUTTON_PRESSED, DOOR_OPENED, BUTTON_RELEASED, DOOR_CLOSED, GOAT_ESCAPED

That sort of thing. Calling them STATE_1, STATE_2 etc. is a bit like calling variables: variable1, variable2, etc. which is pretty useless.