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.
Using: Rpi Pico/Badger 2040/Wavshare RP2040 Zero - joystick, USB HID - setup is:
tinygo flash -target=waveshare-rp2040-zero main.go
or change device to pico/badger2040Here is the behaviour:
Typing
X-32767
shows correctly as X Axis -32767X Axis -32767
Typing
X0
andX1
andX2
also work fineTyping
X3
incorrectly is shown as 1:X Axis 1
Typing
X4
(and upwards) shows raw Windows data as 2 below the expected value:X Axis 2
upwardsTyping
X32767
is incorrect:X Axis 32765
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.