gpio controllers (2 players)
-
@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.
-
@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 -
@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.
-
@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.
-
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
The button order that seems to work best for this configuration is:
Top Row: LB X RB
Bottom Row: Y B A -
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!!
-
@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)
-
@simonster is the gpio layout the same?
-
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)
-
@simonster thanks! you are an amazing person! I was not sure if the pi2 and pi3 had the same layot
-
@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?
-
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.
-
@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.
-
@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.
-
@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!
-
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.
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.