Software timers
Communication protocols
Hardware interrupts
User events
Polled events
A finite-state machine (FSM) is a mathematical model of computation . It is an abstract machine that can be in exactly one of a finite number of states at any given time. The FSM ...