Rotary encoder now working