MHeironimus / ArduinoJoystickLibrary

An Arduino library that adds one or more joysticks to the list of HID devices an Arduino Leonardo or Arduino Micro can support.
GNU Lesser General Public License v3.0
2.06k stars 403 forks source link

Hatswitch return #215

Closed CDRXavier closed 2 years ago

CDRXavier commented 2 years ago

The hat switch cannot return to center (keep being pressed).

CDRXavier commented 2 years ago

The hat switch will "return to center" if you set convertedHatSwitch[hatSwitchIndex] = 8;. The following line, which says convertedHatSwitch[hatSwitchIndex] = (_hatSwitchValues[hatSwitchIndex] % 360) / 45;, is basically converting the "360 degree" notation back into (0 - 7) notation. So in reality, everything about "rotation degree" in the library is BS. Except the part sent as HID report.