Modified rotary encoder reading