RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    How to add a GPIO button to a Retropie (Rpi 3B+) build?

    Scheduled Pinned Locked Moved Help and Support
    retropieraspberrypi 3b+gpio exit roms
    2 Posts 2 Posters 494 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • y-elloY
      y-ello
      last edited by

      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)?

      1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator
        last edited by

        @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).

        1 Reply Last reply Reply Quote 0
        • First post
          Last post

        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.