-
Notifications
You must be signed in to change notification settings - Fork 11
Joystick center position variance #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for the feedback! @brentru you should be able to read the joystick X and Y on init, and assume that those values are the center. If the user turns on their PyGamer with the joystick held out of center, that will of course muck with the real center but this is a common enough approach that it shouldn't be an issue. |
@keebie81 please try the PR that was just created |
This resolved my issue. I just tried it and the cursor works well now and is not auto-drifting. |
@keebie81 Thanks for your feedback! Merged into |
I have two pygamers. Each one has different values given for X and Y on joystick when centered. The code here is assuming that the value is 32767.5 for both X and Y. When the value changes by +-700 then the cursor moves in that direction.
On one of my pygamer devices the X value is ~33344 and Y is ~33632. That puts it out of +-700 range for Y axis and the cursor then moves with no input.
The other pygamer device X value is ~32576 and Y is ~32384. These are within +-700 of the range and works well.
It would be nice if the library checked X and Y center values of device or had a way to put in a line to over-ride default values. I also tested the out of range device with a makecode game and the X and Y axis worked fine and had no drift.
The text was updated successfully, but these errors were encountered: