How to begin writing drivers for an analog PS2 joystick module?
-
I have a PS2 joystick module, from SunFounder that has analog input for the x and y axis as well as a press-button. I know a bit of wiringPI, but how would I pass the inputs from the C program to retropie?
-
Just implement a standard joystick/gamepad driver and it should be detected automatically. Take a look at
xboxdrv
's sources to see how it's done from userspace. -
But it's not a USB input, it goes to BCM pins IO2 and IO3 on my RPi 3B.
-
xboxdrv
is not limited to USB only controllers, it is just an example on how to write a joystick/gamepad driver.
Maybe something like https://github.com/tuomasjjrasanen/python-uinput would be simpler - read the inputs from your device and create a virtual joystick/gamepad which should be read by any programs supporting the standardevdev
interface. -
Alright, I appreciate the help!
-
Bumping because I honestly can't find a good starting point. I need to first figure out how to read analog input, because whatever I try seems to fail.
-
@ian-rosenberg Don't bump topics for no reason, it's rude.
If you can't figure out how to do things, try to find and example - did you look at the Adafruit's code ?
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.