Homepage › Forums › RetroPie Project › Controller Configuration in RetroPie › GPIO to Keys simplest method?
- This topic has 21 replies, 7 voices, and was last updated 8 years, 11 months ago by mholgatem.
-
AuthorPosts
-
04/26/2015 at 21:14 #96250raoulangelParticipant
I have read dozens of messages on here, downloaded modules, configured and edited files and still no luck. If a person starts with a fresh retropie image, is there a simple, basic, step-by-step that I can follow that will let me attach a joystick and 8 buttons to the GPIO, and make them work as up, down, left, right, a, b, enter, escape, tab, pause, select and start? PLEASE this has been two weeks now with no success…
04/30/2015 at 04:02 #96467proaudiosoftParticipantDoesnt look like no one is going to help you with this. I think it’s kinda a taboo topic since their pushing the whole block thingy…..
04/30/2015 at 10:33 #96491joer456ParticipantI am also interested in this topic and cant find a straight forward answer anywhere! The emulators that I use are all RetroArch and I want to use my GPIO pins on my Pi2 as controls.
4x Joystick (up,down,left,right_
1x A
1x B
1x X
1x Y
1X L
1x R
1X Start
1x Select
1X ESCI know how to find and edit the RetroArch.cfg file to change mappings for a keyboard but I was wondering if anyone knew how to map GPIO pins instead of keys?
I’m beginning to think buying a keyboard encoder/ I-PAC is the easiest way of doing this04/30/2015 at 13:25 #96499danielfscParticipantI use this module and works 100% to me. I don´t have a ESC button but I use start+select.
https://github.com/digitalLumberjack/mk_arcade_joystick_rpi04/30/2015 at 18:43 #96509raoulangelParticipantThat mk_arcade_joystick_rpi one I tried over and over… I followed every step, even copied and pasted th commands to the PI using tty, but when I tried to load mk_arcade_joystick module it said the module was not found..
I didn’t miss a step, so where is this mysterious module?
05/01/2015 at 00:10 #96532proaudiosoftParticipantI have a pi2, just got it going using a method, super easy:
Compilation
$ git clone https://github.com/ian57/Raspicade-Retrogame-2Player-Pi2.git
$ cd Raspicade-Retrogame-2Player-Pi2
$ makeRetrogame requires the uinput kernel module. This is already present on the system but isn’t enabled by default. For testing, you can type:
sudo modprobe uinput
To make this persistent between reboots, append a line to /etc/modules (or edit the file) :
sudo sh -c ‘echo uinput >> /etc/modules’
Now we’re in good shape to test it! Retrogame needs to be run as root (need access to memory), i.e.:
sudo ./retrogameGive it a try. If it seems to be working, press control+C to stop the program and we’ll then set up the system to launch this automatically in the background at startup.
sudo nano /etc/rc.local
Before the final “exit 0” line, insert this line:
/home/pi/Raspicade-Retrogame-2Player-Pi2/retrogame &
If you placed the software in a different location, this line should be changed accordingly. “sudo” isn’t necessary here because the rc.local script is already run as root.
Reboot the system to test the startup function:
sudo reboot
05/01/2015 at 10:05 #96562joer456ParticipantI’ve decided to go down the route of using a USB keyboard to create my arcade buttons, seems much simpler. I plan on taking apart the usb keyboard and soldering the buttons and joystick as shown in the below pic. I’ll then edit the cfg files to accommodate for the keys being pressed by the arcade buttons
05/01/2015 at 15:39 #96583raoulangelParticipantActually, if you have the space for all that, I suggest this:
https://www.ultimarc.com/minipac.html
It’s what I used on my Zaxxon Tabletop cab. Super-simple, uses USB for power and I/O, and There was enough room inside the box for the extra board.. I wanted to use the GPIO this time, as I felt all the hype about how useful, convenient and simple it was had convinced me…
05/05/2015 at 13:09 #96951proaudiosoftParticipantits as easy as pie, literally. would be glad to assist anyone.
05/05/2015 at 13:16 #96952raoulangelParticipantProaudiosoft… I am going to work on this tonight.. I’ll follow your previous post and if I hit a wall I’ll hit you up. Thanks
05/07/2015 at 01:10 #97013raoulangelParticipantproaudiosoft, I followed this:
I have a pi2, just got it going using a method, super easy:Compilation
$ git clone https://github.com/ian57/Raspicade-Retrogame-2Player-Pi2.git
$ cd Raspicade-Retrogame-2Player-Pi2
$ makeWhen I typed make, I get:
“make: Nothing to be done for ‘all’.”
What happened? This is not as simple as you made it sound…
05/10/2015 at 23:34 #97235surtanaParticipant@proaudiosoft: I followed your tutorial, but still I don’t get any reaction when using my arcade buttons or joysticks.
I also modified retrogame.c to fit my GPIO connection setup.Should I now be able to Navigate through Emulation Station with the Joystick? By now this ist not possible.
Is there a way to test the Button / GPIO Connection?Greetings
Tobias05/11/2015 at 23:07 #97276surtanaParticipantToday I got a Measure Device. So after some testing I found out, that my wiring ist pretty bad, only 2 of 6 Player1 buttons seem to work and only 1 Joystick direction.
I used an old IDE Cable and cutted of one end to connect the wires to the Buttons.After that I started all over with a new SD Card. I Installed Retropie on it using win32 Disk Imager. Then expanded the file system, changed memory split to 256 and reboot.
I copied the folder Adafruit-Retrogame from my pc to the pie into the roms folder.I think my mistake was thinking the Retrogame makes the Buttons work in EmulationStation, but when connected to a MAME Rom and opening the Input Config there is a reaction to the Buttons. Unfortunately not the way I wanted. The Pins I thought I configured to be KEY_A turns out to be DOWN.
I think I will renew the whole wiring.
Regards
05/11/2015 at 23:33 #97280raoulangelParticipantSo you copied the retrogame.c folder to the ROMS folder? How do you make it run at startup?
05/12/2015 at 09:25 #97297surtanaParticipantI modified this part:
sudo nano /etc/rc.local
Before the final “exit 0″ line, insert this line:
/home/pi/Raspicade-Retrogame-2Player-Pi2/retrogame &
to:
sudo /home/pi/RetroPie/roms/Adafruit-Retrogame/retrogame &
I placed it there, because that’s the folder I had access to from my PC over Network.
05/28/2015 at 16:15 #98598raoulangelParticipantGot it to work great… Here’s the result!!
One other thing, has anyone gotten trackball/mouse/dial controls to work? Is there a driver like the old DOS mouse drivers that are needed?
07/11/2015 at 22:45 #101900phoenixParticipantI didn’t come across this thread until late, but for anyone else working on this, I found the instructions at https://learn.adafruit.com/retro-gaming-with-raspberry-pi/buttons to be quite helpful.
The procedure is essentially what @raoulangel described.
08/08/2015 at 00:04 #103614phoenixParticipantI have found an even better solution – GPIoneer. Just google it. It was designed for “PiPlay”, but works just fine with Retropie. It is very similar to adafruit’s “retrogame”, but much easier to configure using the web interface.
edit: Gpioneer is great for adding Key inputs; but Retropie only sees it as a keyboard, not as a gamepad.
11/16/2015 at 17:08 #110050mholgatemParticipant@phoenix, I know that this post is old; but out of curiosity, what is the difference between Retropie recognizing it as a keyboard vs a gamepad? does Retropie limit functionality on keyboards? I’m the developer of GPioneer, so I’d like to know if I can make this better. I use Piplay, not Retropie; but I’d like GPioneer to be able to support both.
11/16/2015 at 18:07 #110057proaudiosoftParticipantThe absolute easiest and fastest way to setup GPIO and have it integrated to all the emulators: bartop-arcade.com
works fantastic! just check out there products section. Well worth the time saving, and all the frustration.
11/18/2015 at 22:16 #110210phoenixParticipant[quote=110050] @phoenix, I know that this post is old; but out of curiosity, what is the difference between Retropie recognizing it as a keyboard vs a gamepad? does Retropie limit functionality on keyboards? I’m the developer of GPioneer, so I’d like to know if I can make this better. I use Piplay, not Retropie; but I’d like GPioneer to be able to support both.
[/quote]
The difference is when one is stupid. I didn’t realize that all I needed to do was keep holding the button when emulationstation starts configuring. I just pressed it, saw it said “keyboard input”, and gave up. Once I figured that out, I was fine. GPIoneer is by far the best way to interface directly with arcade controls via the GPIO. Kudos, sir.
11/18/2015 at 23:04 #110216mholgatemParticipantah, cool. Well I’m glad that you like it and that it has helped you out!
-
AuthorPosts
- The forum ‘Controller Configuration in RetroPie’ is closed to new topics and replies.