Skip to content
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

Joystick axes reduced by 2 for values of >2 in range -32767..32767 on Windows #4198

Open
andrewfstratton opened this issue Mar 18, 2024 · 1 comment

Comments

@andrewfstratton
Copy link

andrewfstratton commented Mar 18, 2024

Using: Rpi Pico/Badger 2040/Wavshare RP2040 Zero - joystick, USB HID - setup is:

Here is the behaviour:

  • Typing X-32767 shows correctly as X Axis -32767
    • Raw data correctly shows X Axis -32767
    • Command line:
X-32767
Message: X-32767  Axis: 0  send: -32767  State:Axis0Value: -32767
  • Typing X0 and X1 and X2 also work fine

  • Typing X3 incorrectly is shown as 1:

    • Raw data incorrectly shows X Axis 1
    • Command line shows correct values
X3
Message: X3  Axis: 0  send: 3  State:Axis0Value: 3
  • Typing X4 (and upwards) shows raw Windows data as 2 below the expected value:
    • Raw data incorrectly shows X Axis 2 upwards
    • Command line shows correct values
X4
Message: X4  Axis: 0  send: 4  State:Axis0Value: 4
  • Typing X32767 is incorrect:
    • Raw data incorrectly shows X Axis 32765
    • Command line shows correct values
X32767
Message: X32767  Axis: 0  send: 32767  State:Axis0Value: 32767

This has the same, incorrect, behaviour for other axis

Note: I have checked the joystick package Max/Min In/Out conversion and that seems to work fine (I copied the code into Go playground and tried it for the same values).

I think the issue is further down, possibly in tinyusb itself.

I have tried it on another PC (win 10) and got the same error above - the 0.99994 value for 32767.

I did try this on MacOS and Android - but neither recognised the Pico - so I couldn't get any results there...

I may have made some stupid mistake in my code - which I can't see - but I do think there is some issue there that most users wouldn't see but is incorrect since the axis cannot reach their maximum limit.

@andrewfstratton andrewfstratton changed the title Joystick axes never reach maximum value on Windows Joystick axes reduced by 2 for values of 2+ in range -32767..32767 on Windows Mar 21, 2024
@andrewfstratton
Copy link
Author

I have update the issue with further clarification when I discovered that the error happens for values of >2 for an axis range of -32767..32767

@andrewfstratton andrewfstratton changed the title Joystick axes reduced by 2 for values of 2+ in range -32767..32767 on Windows Joystick axes reduced by 2 for values of >2 in range -32767..32767 on Windows Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant