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.1k stars 409 forks source link

Joystick on M1 Mac #187

Closed Ja-Hey-64 closed 2 years ago

Ja-Hey-64 commented 3 years ago

I've been trying to make a sim Wheel to work with my M1 Mac Book but have'nt quite got it to work in game the axes show up but only have the input value assigned to them, that was present on start up. This means I can change the input value with reuploading my code but not with something like a potentiometer. For comparison I also testet the exact same code on an Intel Mac and it worked just fine. Maybe anybody has an Idea? I think this may be an issue with how the new Mac handle they IO but I am really not an expert when it comes to USB communication.

Technical Details

Sketch File that Reproduces Issue

#include <Joystick.h>

#define zAxisPin A0

Joystick_ Joystick;

int zAxis_ = 0;

const bool initAutoSendState = true; 

void setup() {
 //Serial.begin(9600);
 Joystick.begin();

}

void loop() {

zAxis_ = analogRead(zAxisPin);
zAxis_ = zAxis_ / 3;
zAxis_ = zAxis_ * 3;
//Serial.println(zAxis_);
Joystick.setZAxis(zAxis_);

delay(50);

}

Wiring Details

Any pin wiring details that may be relevant.

Additional context

Add any other context about the problem here.

MHeironimus commented 2 years ago

You might try updating to the latest version of the library (2.1.0) and see if you are still having the issue on the M1 Macs. I do not have an M1 Mac to test with.

Ja-Hey-64 commented 2 years ago

The issue seems to not be caused by the joystick library, but rather by the rosetta translation. I previously tested it with Euro Truck simulator 2 and the Farming Simulators 2017/19. In the recently released Farming Simulator 2022 the device works just as expected (this game runs natively). I am sorry for getting this wrong and am very thankful for this great library.