You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to make a controller similar to an PS4 controller and use it in some games which I play.
My setup is pretty simple, in a Arduino UNO with a potentiometer:
5V (Power) - Vcc
A0 (Analog In) - Out
Ground (Power) - GND
Vcc, Output, GND refers to pins in a potentiometer
What my code does is as I rotate the potentiometer, the IO MCU reads the analog value and sends it to the USB MCU via the HID Bridge and updates the gamepad's x axis. This actually works exactly as I expected, by confirming with HoodLoader2 16u2 game controller properties in the control panel, Input viewer in Joystick Gremlin, gamepad-tester, gamepadviewer.
But the problem is, these inputs are not being recognized by any game in my PC. I have no idea why. Should I enable something so that I can get this working, or am I missing something ?
Please let me know if someone has a solution for this. I have pasted my code below for reference.
Sketch uploaded to USB MCU
#include<HID-Project.h>#include<HID-Settings.h>#defineMIN16BIT -32768.0
#defineMAX16BIT 32767.0
voidsetup()
{
Serial.begin(9600);
Serial1.begin(9600);
Gamepad.begin();
}
voidloop()
{
intbase100=Serial1.read();
Serial.print(base100); // to display data received from IO MCUfloatnum= (base100-50.0) / 50.0;
intaxis=0;
if (num>0) axis=num*MAX16BIT;
if (num<0) axis=num*-1*MIN16BIT;
Gamepad.xAxis(axis);
Gamepad.write();
}
I am trying to make a controller similar to an PS4 controller and use it in some games which I play.
My setup is pretty simple, in a Arduino UNO with a potentiometer:
Vcc, Output, GND refers to pins in a potentiometer
What my code does is as I rotate the potentiometer, the IO MCU reads the analog value and sends it to the USB MCU via the HID Bridge and updates the gamepad's x axis. This actually works exactly as I expected, by confirming with HoodLoader2 16u2 game controller properties in the control panel, Input viewer in Joystick Gremlin, gamepad-tester, gamepadviewer.
But the problem is, these inputs are not being recognized by any game in my PC. I have no idea why. Should I enable something so that I can get this working, or am I missing something ?
Please let me know if someone has a solution for this. I have pasted my code below for reference.
Sketch uploaded to USB MCU
Sketch uploaded to IO MCU
The text was updated successfully, but these errors were encountered: