Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct mapping in joystick tester but wrong in game #275

Open
bbuster2 opened this issue May 10, 2023 · 0 comments
Open

Correct mapping in joystick tester but wrong in game #275

bbuster2 opened this issue May 10, 2023 · 0 comments

Comments

@bbuster2
Copy link

bbuster2 commented May 10, 2023

I am not sure if this is a bug with the library but since i could not find any issue on the game i am asking here.
I am trying to build a game button box for Farming simulator and use the library to simulate 32 button presses. Each with an on and off delay.

I start the game and map every simulated button press to a single action.
Button 1 till button 16 are correct but then it jumps to button 25, 26, 27, 28, 29, 30, 31, 32 and back to 25 till 28 again.
If i check the windows gamepad tester it does loop from button 1 till 32, also https://gamepad-tester.com/ does this correct.
What can this be? I don't see any issue on a website asking for this problem in Farming Simulator 2022 and i would guess other joysticks use button 17 ill 26 ass well?

Technical Details

I have tested it with an Arduino Micro on Windows 10 with Arduino IDE version 2.0.4

Sketch File that Reproduces Issue

#include <Arduino.h>
#include <Joystick.h>

Joystick_ Joystick(JOYSTICK_DEFAULT_REPORT_ID,JOYSTICK_TYPE_GAMEPAD,
  32, 1, 
  true, true, true,
  true, true, true,
  true, true,
  true, true, true);

void setup() {
  Joystick.begin();
  Serial.begin(115200);
  delay(5000);
}

void loop() {
  for(int i = 0; i < 32; i++) {
       Serial.print("Turn on button ");
       Serial.println(i + 1);

       Joystick.setButton(i, 1);
       delay(1000);
       Joystick.setButton(i, 0);
       delay(1000);
     }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant