Page 1 of 1

GPIO input + external joypad

Posted: Sun May 29, 2016 4:42 pm
by Cannikin
I had to fight with this for a while but I figured it out and wanted to save everyone else the pain!

If you're using GPIO for input (this may apply for the Teensy as well) and want to have a joypad connected via USB so you can have two players, you need to make a couple of edits to the retroarch.cfg file. Without these edits your connected joypad acts like player 1 and will do the same thing as the controls on the GB itself.

Set up your joypad first (press START and go to Configure Input and follow the prompts). Now exit emulationstation and from the terminal type:

Code: Select all

nano /opt/retropie/configs/all/retroarch.cfg
Move down to the lines where you see input_player1_a, input_player1_b, etc. (Actually these config settings could go anywhere in the file, but having them here with the rest of the input stuff is cleaner.)

Now, your USB joypad will be considered input 0. For whatever reason, apparently the GPIO keyboard (and maybe Teensy) will be considered input -1. I haven't found this recorded anywhere, I just tried it and it worked. Add these two lines before or after the input_player1 lines:

Code: Select all

input_player1_joypad_index = -1
input_player2_joypad_index = 0
Hope that helps someone else!

Re: GPIO input + external joypad

Posted: Tue May 31, 2016 10:27 pm
by Popcorn
Interesting. "-1" means false or disable. So I think, what is happening is that you are disabling gamepads for player 1. And the Teensy is acting as a keyboard so that's ok. Nice find.

Re: GPIO input + external joypad

Posted: Tue May 31, 2016 10:40 pm
by 1461748123
Nice! Moving this to software tutorial section :)

Re: GPIO input + external joypad

Posted: Sun Jul 17, 2016 5:53 am
by GnobarEl
What a "simple" solution! I was having a pain with it!

Thanks for sharing.

Cheers