Open helpme2k2 opened 4 years ago
I don't know if you should be worried about the html5gamepad test; I have made a set of sim pedals that shows up in chrome with +/- infinity and does not show up at all in mozilla. Despite this, they work perfectly fine in Assetto Corsa.
A piece of software that correctly displays all inputs is one made by Leo Bodnar, called DiView.
http://www.leobodnar.com/shop/index.php?main_page=page&id=12
You should see the actual information sent by the microcontroller there.
Hope this helps
Description of Issue
When I use the GamepadExample that comes with the library on my Lenoardo and test it against Firefox and Chrome (https://html5gamepad.com/), the two browsers produce different result. Firefox's axis reading are all correct but the axis reading from Chrome v81.0.4044.138 returns NaN (when it should be 0) and +/- infinity (when it should be +/-1).
I figured the above issue only appear if I use the constructor with customized number of axis and button like below,
If I use
Joystick_ Joystick;
or evenJoystick_ Joystick(JOYSTICK_DEFAULT_REPORT_ID,JOYSTICK_TYPE_GAMEPAD);
Although there will be non-used axis and button, but the issue of NaN on Chrome is gone.Technical Details
Sketch File that Reproduces Issue
GamepadExample from the joystick library 2.0.5
Wiring Details
no wiring
Additional context
Add any other context about the problem here.