Digital Timer
This page demonstrates a number of techniques.
The Go/Stop button is a latching button. One click starts the timer, a second click stops it. The visual states of the button are off, clicked (pressed in) and on – with the light showing the on state. The reset button only requires two states because it has 'momentary' action.
The numerals use the 'film-strip' animation technique too, but there are eleven states – 0 to 9 and a blank. The appropriate numbers are shifted into place by the doDigit() function which is driven by the refreshClock() function.