How to - Use the GPIO for Buttons instead of a Teensy

Various user-contributed guides for hardware-related things
snoek09
Posts: 145
Joined: Sat May 20, 2017 3:06 am
Location: Amsterdam, The Netherlands
Has thanked: 48 times
Been thanked: 43 times

Re: How to - Use the GPIO for Buttons instead of a Teensy

Post by snoek09 » Sun Aug 12, 2018 12:33 pm

Yes, that's correct. As long as you update retrogame.c with the correct values it should be fine.

markag
Posts: 3
Joined: Tue Sep 04, 2018 1:02 pm

Re: How to - Use the GPIO for Buttons instead of a Teensy

Post by markag » Fri Sep 07, 2018 2:44 pm

Does this also work for full sized raspberry pi boards (pi 2 or pi 3)?

Looking to build my own handheld RetroPie gaming device with the 7" pi screen. Would be interested in doing GPIO buttons for that to keep the USB ports free and cost down.

User avatar
Helder
Trailblazer
Trailblazer
Posts: 2985
Joined: Thu May 05, 2016 8:33 am
Location: Rogers, AR
Has thanked: 1459 times
Been thanked: 3114 times

Re: How to - Use the GPIO for Buttons instead of a Teensy

Post by Helder » Fri Sep 07, 2018 3:21 pm

Yes you can.
Chat with me and other members On Discord

Don't contact me about obtaining my board files (as you will not get them). If my Boards or PCB Kits are sold out, they will be restocked as soon as I can get them and there is demand for them. You can join the mailing list on my Website to be notified when they are available.


Helder's Game Tech Website

We will not support any cloned work so don't come to us with technical issues to resolve, go talk to the cloner for help.

markag
Posts: 3
Joined: Tue Sep 04, 2018 1:02 pm

Re: How to - Use the GPIO for Buttons instead of a Teensy

Post by markag » Mon Sep 10, 2018 1:51 pm

Maybe It's a silly question... Do I need to apply 5V power to the buttons to make them function?

I breadboarded out a controller with buttons that bridge back from the GPIO pin to ground. Some of the buttons worked, others didn't. I was concerned on those that did not work that I maybe had a wiring issue or bad connection on my button, so I tried manually connecting the IP pin to my ground as a button press, and still got nothing.

Was using a Raspberry Pi 3B+

The only buttons that worked were connected to BCM 0, 5, & 6. I was using the ground from pin 39 for all the buttons.

I didn't install onto a clean RetroPie build, but it was pretty close to clean. I'm using the Raspberry Pi official 7" touchscreen, my retropie build has a few skins, and I ran the retropie update on it at one point in time. That's it. I didn't have any errors or anything when going through the setup.

User avatar
goosewerks
Posts: 93
Joined: Mon May 22, 2017 8:27 am
Has thanked: 18 times
Been thanked: 39 times

Re: How to - Use the GPIO for Buttons instead of a Teensy

Post by goosewerks » Wed Sep 12, 2018 6:41 am

markag wrote:
Mon Sep 10, 2018 1:51 pm
Maybe It's a silly question... Do I need to apply 5V power to the buttons to make them function?

I breadboarded out a controller with buttons that bridge back from the GPIO pin to ground. Some of the buttons worked, others didn't. I was concerned on those that did not work that I maybe had a wiring issue or bad connection on my button, so I tried manually connecting the IP pin to my ground as a button press, and still got nothing.

Was using a Raspberry Pi 3B+

The only buttons that worked were connected to BCM 0, 5, & 6. I was using the ground from pin 39 for all the buttons.

I didn't install onto a clean RetroPie build, but it was pretty close to clean. I'm using the Raspberry Pi official 7" touchscreen, my retropie build has a few skins, and I ran the retropie update on it at one point in time. That's it. I didn't have any errors or anything when going through the setup.
No you do not. You just have to connect the GPIO pin to a GPIO ground completing each circuit per button press.

Hunter Miller-Moreno
Posts: 3
Joined: Sat Sep 15, 2018 12:59 pm
Been thanked: 2 times

Re: How to - Use the GPIO for Buttons instead of a Teensy

Post by Hunter Miller-Moreno » Sat Oct 06, 2018 10:27 pm

It works in emulation station, but for some reason after I load a game it no longer works. Advice??

Kabuki
Posts: 1
Joined: Thu Nov 08, 2018 3:29 pm

Re: How to - Use the GPIO for Buttons instead of a Teensy

Post by Kabuki » Thu Nov 08, 2018 3:36 pm

hello ! im so close i feel...
this works upon entering the command
" sudo ./retrogame "
i can navigate through the retropie menu and play games with working buttons.
however after entering the command to have it launch automatically on boot ;
" /home/pi/Adafruit-Retrogame/retrogame & "

it does not take effect and i have to re enter " sudo ./retrogame " to have button function back..

im using a Pi zero w with a common ground 4 button pcb.. so close ! THANKS!

"UPDATE" fixed..
i tried this and worked upon a reboot ... https://www.tinkerboy.xyz/retropie-sdca ... r-support/

sonyeoneon
Posts: 1
Joined: Sat Oct 12, 2019 8:37 pm

Re: How to - Use the GPIO for Buttons instead of a Teensy

Post by sonyeoneon » Sat Oct 12, 2019 9:10 pm

It works perfectly, but, now i want to add R2, L2 and the hotkey, i have already modify the charts in retrogame.c in my computer, do i have to re-do all from the beginig to update the new buttons?

User avatar
Lphillimore
Posts: 993
Joined: Sat Jan 07, 2017 7:03 pm
Location: Perth, WA
Has thanked: 796 times
Been thanked: 527 times

Re: How to - Use the GPIO for Buttons instead of a Teensy

Post by Lphillimore » Sat Nov 16, 2019 1:24 am

sonyeoneon wrote:
Sat Oct 12, 2019 9:10 pm
It works perfectly, but, now i want to add R2, L2 and the hotkey, i have already modify the charts in retrogame.c in my computer, do i have to re-do all from the beginig to update the new buttons?
No, just pick 2x free GPIO and use those for your L2 and R2 and modify / extend the script.

You can use an existing key / button GPIO as your Hotkey.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest