rotary encoder debounce with FSM