How to add a GPIO button to a Retropie (Rpi 3B+) build?
-
I've made this build, it works great, but I have a free button on the case that I wish to use for an extra command: maybe for exit emulator or open retroarch menu.
My knowledge of Linux is very basic (copying stuff from the web + try hard), so I would like any help from you guys.
Can I use a GPIO wired push button for exit emulator? how?
Can I use another button for retroarch menu (and maybe for mame menu on MAME)? -
@y-ello said in How to add a GPIO button to a Retropie (Rpi 3B+) build?:
Can I use a GPIO wired push button for exit emulator? how?
Assuming you have a the button wired to a GPIO (there's tons of tutorials and documents on using a RPI with a button), you can use something like GPIONext to run a script whenever you press the button.
RetroArch has a network control interface, to which you can send commands from the script you attach to the button press (pause RA, open the menu, exit, etc.) - see more details here. Since most emulators in RetroPie are just libretro cores and run within RetroArch, it might be enough to cover most emulators, but you can also simulate a keyboard with GPIONext and simulate a key press for the button push (i.e. for opening the MAME menu).
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.