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

Rudder not showing up for Arduino Controller using an Arduino Leonardo #232

Open timt opened 2 years ago

timt commented 2 years ago

Description of Issue

Hi,

I am trying to build rudder peddles for the Condor 2 flight sim using an arduino learonardo. Using the defaults in the Joystick constructor I would expect the Rudder to show up in the device controller (Windows 10) but they do not (see screenshot). The other controls do and I have been able to control/set them successfully using a potentiometer.

Any idea what why the rudder does not show up in the ardiuno game controller test panel in windows?

Technical Details

Sketch File that Reproduces Issue

#include <Joystick.h>

#define SENSOR_RUDDER A0

Joystick_ Joystick;

int input_val;

void setup() {
  Serial.begin(9600);
  pinMode(SENSOR_RUDDER, INPUT); 
  Joystick.begin();
}

void loop() {
    input_val = analogRead(SENSOR_RUDDER); 
    Serial.println(input_val);
    Joystick.setRudder(input_val);
    Joystick.setZAxis(input_val);
    Joystick.setRzAxis(input_val);
    delay(50); // Delay for data time smoothing
}

Wiring Details

Wired a potentiometer up to A0, produces the values 0-1023

Additional context

Screenshot 2022-01-20 130730

bwanaaa commented 2 years ago

although Joystick.setRudder(input_val); is in the documentation, I dont see how it would show up in the usb game controller. When I run your sketch, there is significant latency. When I remove the Joystick.setRudder line it runs smoothly.