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

    gpio controllers (2 players)

    Scheduled Pinned Locked Moved Help and Support
    gpiocontroller2 playerspi3
    17 Posts 5 Posters 9.7k 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.
    • B
      brurpo
      last edited by

      Hi there and thanks a lot for your time!
      I've been searching for 2 days now and everything that I find seems to be for other OSes and outdated.
      Can anyone point me in the right direction? I have a raspberry pi3, 2 pads and 20 buttons (28 inputs?)

      What software do I use? Also it's a bit confusing which gpio pins are usable.

      Thanks a lot guys!

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

        @brurpo 28 inputs seems like a lot for GPIO. I know of two software solutions. The first is Adafruit's Retrogame. This has been around for a while and is well-tested, but configuration is not super friendly.

        The other is mholgatem's GPIOneer. This is my favorite. It has an interactive configuration, then a web interface once setup that lets you add/change settings, and it even lets you setup combo functions (multiple buttons that, when combined, perform some function). Best of all, you can easily enter bash commands making it perfect for shutdown triggers, volume control, or anything else you can do via command line.

        I just don't know the maximum available inputs for these, but it is probably a Pi limitation not a software limitation.

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

        B 1 Reply Last reply Reply Quote 1
        • B
          brurpo @caver01
          last edited by brurpo

          @caver01 wow thanks a lot for the quick reply!

          I probably won't use all the 28, I will probably use only MAME, so I was thinking on the most complex arcades and snes, the stick, x,y,b,a,lt,rt,select,start. That's 12 for each player, 24 buttons, maybe I can ditch the select?
          Looking at the pi3 40 pin gpio chart, I have 17 greens, 6 unusable and the others are "maybe" that's really confusing

          caver01C 2 Replies Last reply Reply Quote 0
          • caver01C
            caver01 @brurpo
            last edited by

            @brurpo You might shoot a message off to mholgatem on github to find out how many pins GPIOneer supports. I have never checked, as I only use GPIO for a handful of admin functions.

            I wouldn't give up Coin (select). You will need it for arcade games. Some folks try to use just one coin, and map other player coins to it, but I think this is a mistake. Many games detect coin deposit by player (adding health or whatever).

            Select, which ends up doubling as COIN applies to console emulators, so if you plan to setup NES, SNES etc, you will want a select button for both players.

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

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

              @brurpo If you insist on two players, 6 action plus start and coin per player and cannot get away with just GPIO, it is worth the extra $$ to use an IPAC or something similar.

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

              1 Reply Last reply Reply Quote 1
              • simonsterS
                simonster
                last edited by simonster

                Hi, I use mk_arcade_joystick_rpi to achieve something similar in my Bartop Arcade Cabinet. I have the full Super Nintendo set of buttons for each player (see image at bottom of post).

                If you want to go down this route, use the wiring diagram on their website (for the RPi2, it still works): https://github.com/recalbox/mk_arcade_joystick_rpi but do not follow their install instructions for the software. I will check as it used to be in the optional components on RetroPie.

                [EDIT] It is in the drivers section, called mkarcadejoystick

                0_1494351270173_Arcade.jpg

                The button order that seems to work best for this configuration is:

                Top Row: LB X RB
                Bottom Row: Y B A

                H 1 Reply Last reply Reply Quote 1
                • B
                  brurpo
                  last edited by brurpo

                  Wow!! This is the best forum ever, no kidding! I have never seen such activity and willingness to help others! Thanks so much!!

                  @caver01 Thanks so much! I will shoot him a message! Also, I was thinking on the IPAC, but I wanted to go the GPIO way as I live in Brazil and I would have to import it as I have not found it anywhere, it would be expensive and take a very long time to arrive.

                  @simonster WOW! Thats amazing!! Thanks so much! I think thats exactly what I need!!

                  simonsterS 1 Reply Last reply Reply Quote 0
                  • simonsterS
                    simonster @brurpo
                    last edited by

                    @brurpo No problems, let me know if you need any assistance, I have had it working for about 18 months now (originally on a Pi2 and now on a Pi3)

                    B 1 Reply Last reply Reply Quote 1
                    • B
                      brurpo @simonster
                      last edited by

                      @simonster is the gpio layout the same?

                      1 Reply Last reply Reply Quote 0
                      • simonsterS
                        simonster
                        last edited by

                        This is the pinout you need, pin 1 is nearest the display connector (hold the Pi with the USB ports pointing downwards to match the image)
                        alt text

                        B 1 Reply Last reply Reply Quote 1
                        • B
                          brurpo @simonster
                          last edited by brurpo

                          @simonster thanks! you are an amazing person! I was not sure if the pi2 and pi3 had the same layot

                          1 Reply Last reply Reply Quote 0
                          • H
                            helitoncosta @simonster
                            last edited by

                            @simonster Nice bartop! WoW. Tell my on thing... I din't try yet, but I'm using Retropie 4.0, this gpio instructions and driver config for recalbox will work in it?

                            simonsterS 1 Reply Last reply Reply Quote 0
                            • simonsterS
                              simonster @helitoncosta
                              last edited by

                              @helitoncosta

                              If you are using RetroPie, you can install it from the RetroPie Setup menu. It will work fine.

                              If you are using recalbox, the pinout above is the default for recalbox. However I don't know about configuring it as I don't use it.

                              H 1 Reply Last reply Reply Quote 0
                              • H
                                helitoncosta @simonster
                                last edited by

                                @simonster Hello, I'm using retropie 4.0, do you know what are all steps to configure the retropie to recognise gpio pins directly to the buttons and directional switchs? I just installed the snesdev drive in the retropie config and enable it in the autorun emulationstation, but when i try press any button nothing happens.

                                1 Reply Last reply Reply Quote 0
                                • simonsterS
                                  simonster
                                  last edited by

                                  @helitoncosta , You have the wrong driver. You need mk_arcade_joystick from the drivers menu in RetroPie setup. Once you have done that, if you have connected to gpio pins as per the diagram, attaching the ground of each switch to a ground on the Pi, it will detect 2 joysticks with 8 buttons each. You can then configure these in Emulation Station.

                                  1 Reply Last reply Reply Quote 0
                                  • C
                                    Chubbz619
                                    last edited by

                                    @simonster I am on retropie 4.4.1 trying to get my 2nd player to work and it detects it but doesnt detect me pressing the buttons and help? Thanks!

                                    simonsterS 1 Reply Last reply Reply Quote 0
                                    • simonsterS
                                      simonster @Chubbz619
                                      last edited by

                                      @chubbz619

                                      What do you mean, it detects it?

                                      Can you give some information about your setup, are you using mk_arcade_joystick? How have you configured it? What hardware are you using?

                                      Try filling out the info from the read this first post linked at the top of the page.

                                      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.