added initial code to read out rotary encoders