I am trying to control the mouse with too rotary encoders to use as interface for a video game.
As for now it works, but i have a linearity problem with it.
I realized that depending on the speed of rotation the mouse doesn't move the same amount.
With a quick rotating speed the mouse moves way more than with a slower speedfor the same angular change of the encoder.
Paul_KD7HB:
Are you asking about a mouse or are you asking about the cursor on your computer screen?
Paul
Hi Paul,
Sorry for not being specific. I meant the mouse cursor.
For exemple if I rotate the encoder 180° slowly the mouse cursor will move lets say 1/4 of the screen, but if doing the same 180° quickly it will move 3/4 of the screen.
Here in the code pulsesX and pulsesY are the encoders inputs (position values, not speed).
I corrected the code using only those parameters, but still had the problem.
Just found out that it is in fact the mouse acceleration parameters on my OS that was doing that.
After using a utility to set the mouse acceleration it now works perfectly.