playAbilityTech / Arduino-JoyCon-Library-for-Nintendo-Switch

Transform your ATmega32u4 based Arduino boards into Nintendo Switch-compatible gamepads! This library enables the Arduino Leonardo, Micro, or compatible clones to be recognized as HID game controllers with customizable inputs. Featuring support for up to 16 buttons, a hat switch, and dual analog sticks with 8-bit precision
GNU Lesser General Public License v3.0
97 stars 8 forks source link

No Dpad #3

Closed D3adPlays closed 3 years ago

D3adPlays commented 3 years ago

Hello, i have testes your software and didn't find the dpad number code, Are they implemented yet?

Jorand commented 3 years ago

Hi @D3adPlays, yes you can use Joystick.setHatSwitch(int16_t value). The value is from 0° to 360°, but in 45° increments.

Joystick.setHatSwitch(0); // UP
Joystick.setHatSwitch(90); // RIGHT
Joystick.setHatSwitch(180); // DOWN
Joystick.setHatSwitch(270); // LEFT

Joystick.setHatSwitch(-1); // RELEASE