Working half-step quadrature encoder on RPi