I have a pair of 20-detent rotary encoders wired to an Arduino teensy. The teensy reads a change in one of the channels and sends a joystick button press.
The problem is that if I spin the encoder with any kind of speed, it starts to go backwards for some of those presses, and averages out to 50 forward/50 backward.
So:
1) Why is this happening?
2) How do I fix it?
My guess it the problem could be a delay between when the encoder moves and when the arduino reads it and compares it to the last known position. Currently the program runs at 200 times a second, and I think that would be fast enough to eliminate this problem at normal speeds.