can udev read i2c and hardwired GPIO buttons simultaneously?
-
I'm trying to create a joypad similar to a classic nes controller to work in retroarch. I want to use a wii nunchuck for the joystick and select and start buttons and also have two buttons hardwired to the raspberry pi 3b running retropie 4.4
i finally got the nunchuk to send other data than 255, it seemingly is working including the c and z buttons. my A and B buttons are wired to specific GPIOs.
Is it possible to create a joypad from this setup to be able to play games in retropie? or is it not possible?
thank you for any advice!
-
@krullbeast You can try to see if any of the GPIO based modules for joypads works for your setup - https://retropie.org.uk/docs/GPIO-Modules/. But if you only have the A/B buttons wired to the GPIO it might now work - insufficient buttons.
Othwise, you'll need to create your own virtual keyboard - similar to how https://github.com/adafruit/Adafruit-Retrogame works. -
@mitu thank you!
i'll try the gamecon advice and see what happens. do you think it is possible to read the i2c data and also the A and B buttons inside of retroarch? -
@krullbeast said in can udev read i2c and hardwired GPIO buttons simultaneously?:
do you think it is possible to read the i2c data and also the A and B buttons inside of retroarch?
Not an expert on this, but I think RetroArch doesn't read directly from GPIO (I2C or otherwise), instead it uses an established input driver (udev/sdl/etc.) - https://github.com/libretro/RetroArch/tree/master/input/drivers.
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.