RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    GPIO connected button with Start/Select exit command?

    Scheduled Pinned Locked Moved General Discussion and Gaming
    gpioraspberry pi 3python buttonspython
    2 Posts 2 Posters 1.5k 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.
    • anasazi29A
      anasazi29
      last edited by

      I have seen Power buttons using a Python script, but can I make a button that is connected to a GPIO as my exit button from emulators? ie "Start/Select"
      I'm not sure what to write in the python script for that.
      Thanks,
      Anasazi

      RPi3, RP 4.1.8, I have installed python and have the background music playing during the menus that @Livewire posted. works great.

      caver01C 1 Reply Last reply Reply Quote 0
      • caver01C
        caver01 @anasazi29
        last edited by

        @anasazi29 Broadly speaking, here is what you need to do: You need a python script that will watch a GPIO pin (that you have wired to a normally open switch like an arcade button--other wire to ground) such that when the button is pressed, the script sends a keypress. The key you send (suggestion: "ESC") would have to be picked up by the emulator as EXIT. So, you will have to go into your retroarch.cfg file, disable the hotkey function, and set the EXIT function to "ESC".

        I know of a few ways this has been done in the past. One of the more popular is to use the adafruit Retrogame software. This basically takes care of the scripting process and leaves it up to you to configure what keys the GPIO pins trigger. Some folks use ONLY this solution for input control.

        I also like mholgatem's GPIOneer which does the same thing, but uses a more elegant interactive configuration, then a web interface once it is setup. It is also easy to configure combo keys and to send full commands (I use it to send commands to increase and decrease master volume).

        My 4-player cocktail style cabinet built as a custom "roadcase"

        1 Reply Last reply Reply Quote 1
        • 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.