Rotary-enocder FSM for PIC18 Finite-state-machine implementation to support rotary-encoders on PIC18.