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

Various user-contributed guides for hardware-related things
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 » Wed Oct 11, 2017 5:11 pm

DalThePal wrote:
Wed Oct 11, 2017 2:53 pm
I followed all of these steps with my sd Card in a rpi A and retropie would boot up fine. When I place the same card into my rpi zero it can’t finish booting. It reaches the retropie screen and then crashes and tries to boot again. It just does this on a continuous loop. Does anyone now what I’ve done wrong?
Use the image specifically for the Zero

DalThePal
Posts: 4
Joined: Wed Oct 11, 2017 2:46 pm

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

Post by DalThePal » Fri Oct 13, 2017 2:28 pm

Lphillimore wrote:
Wed Oct 11, 2017 5:11 pm
DalThePal wrote:
Wed Oct 11, 2017 2:53 pm
I followed all of these steps with my sd Card in a rpi A and retropie would boot up fine. When I place the same card into my rpi zero it can’t finish booting. It reaches the retropie screen and then crashes and tries to boot again. It just does this on a continuous loop. Does anyone now what I’ve done wrong?
Use the image specifically for the Zero
I just did a fresh install with the correct image but I'm still getting the same results.

DalThePal
Posts: 4
Joined: Wed Oct 11, 2017 2:46 pm

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

Post by DalThePal » Thu Oct 19, 2017 4:55 pm

DalThePal wrote:
Fri Oct 13, 2017 2:28 pm
Lphillimore wrote:
Wed Oct 11, 2017 5:11 pm
DalThePal wrote:
Wed Oct 11, 2017 2:53 pm
I followed all of these steps with my sd Card in a rpi A and retropie would boot up fine. When I place the same card into my rpi zero it can’t finish booting. It reaches the retropie screen and then crashes and tries to boot again. It just does this on a continuous loop. Does anyone now what I’ve done wrong?
Use the image specifically for the Zero
I just did a fresh install with the correct image but I'm still getting the same results.
I found that when I power it using USB it boots up just fine. I checked the connections for powering through HDMI but they're fine. I'm at a loss. anybody have any ideas?

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 » Fri Oct 20, 2017 1:51 am

DalThePal wrote:
Thu Oct 19, 2017 4:55 pm
DalThePal wrote:
Fri Oct 13, 2017 2:28 pm
Lphillimore wrote:
Wed Oct 11, 2017 5:11 pm


Use the image specifically for the Zero
I just did a fresh install with the correct image but I'm still getting the same results.
I found that when I power it using USB it boots up just fine. I checked the connections for powering through HDMI but they're fine. I'm at a loss. anybody have any ideas?
Hmm doesn't make a lot of sense. I've never had any issues with a fresh install of the 0 image on an SD. This is the stock retropie image, right?

You can either setup the Pi Zero for Wifi in headless mode or plug a USB controller in, navigate to Wifi, plug a keyboard in to configure etc. then reboot.

Once on the Wifi and after SSH is enabled I clear the Emulationstation settings if using the above keyboard method. Complete the GPIO button setup, reboot and all good.

Golddeenoh
Posts: 27
Joined: Tue Dec 05, 2017 12:29 pm
Has thanked: 9 times
Been thanked: 1 time

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

Post by Golddeenoh » Wed Dec 20, 2017 7:26 pm

Apparently 4.3 doesn't have an Adafruit-Retrogame directory. any other suggestions on how i can get the directory added so i can add the GPIO file into one.

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 » Thu Dec 21, 2017 12:52 am

RetroPie doesn't contain that folder. You have to put it there yourself. See the instructions in the first post of this topic: viewtopic.php?f=22&t=57#p525

User avatar
Mr. Breaker_
Posts: 6
Joined: Sun Sep 24, 2017 4:52 am
Location: The Netherlands
Has thanked: 3 times
Been thanked: 2 times

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

Post by Mr. Breaker_ » Mon Dec 25, 2017 12:58 pm

prerunnerseth wrote:
Sat May 07, 2016 2:14 pm
This tutorial provided by http://www.prs-tech.com

Updated 4/6/2017

Update 7/24/2017
...


Download the retrogame.c file at the google drive link below and place in a directory on your Pi Zero SD card.
https://drive.google.com/open?id=0B9I5H ... EhKUFJOb2M

I used FTP to get to my pi zero and made the Adafruit-Retrogame directory in the /home/pi directory. This is the directory referenced later in code in this tutorial. So its best to stick to this.
Instead of using FTP just make an "Adafruit-Retrogame" directory in /home/pi.

Code: Select all

cd /home/pi

Code: Select all

sudo mkdir Adafruit-Retrogame
Then

Code: Select all

sudo nano /home/pi/Adafruit-Retrogame/retrogame.c
Which opens an empty nano screen just copy the content of the "retrogame.c" file and paste it here and writeout. It will take a few seconds but it's much faster as setting up FTP only for this file...
as of retropie 4.2 SSH is now disabled by default. to enable
press F4 on a keyboard then.

...

User avatar
tinkerBOY
Posts: 710
Joined: Tue May 30, 2017 4:00 am
Has thanked: 294 times
Been thanked: 206 times

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

Post by tinkerBOY » Tue Dec 26, 2017 7:33 am

For those having a hard time setting up the Retrogame utility program, you can just get a copy of RetroPie with the utility program already pre-installed.
New! tinkerBOY PowerSwitch v1.0 with Safe Shutdown
Game Boy Zero Controllers available @ tinkerBOY.xyz * Support
tinkerBOY Controller v3.0 - built-in usb controller, usb audio, and usb hub
tinkerBOY Controller v2.0 - GPIO buttons and builtin PWM Audio and Amplifier
tinkerBOY Controller v1.1 - simple pcb button
* DPI Adapter - better display for GBZ
* keyboard converters - IBM XT/AT Soarer's Converter | ADB to USB Converter

chrissantamaria
Posts: 4
Joined: Thu Mar 15, 2018 6:37 pm
Been thanked: 1 time

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

Post by chrissantamaria » Fri Apr 27, 2018 9:39 am

Not sure how recently their article was updated but the Adafruit page has a much simpler guide which just worked with my RetroPie image.
https://learn.adafruit.com/retro-gaming ... s-software

Their script basically holds your hand through all of the steps (including starting on boot and the fix for RetroPie). All I had to do was edit the cfg file for my button pins.

Penniwhistle
Posts: 3
Joined: Sat Aug 11, 2018 6:26 pm
Been thanked: 1 time

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

Post by Penniwhistle » Sat Aug 11, 2018 6:32 pm

Hello! I'm hoping to use this plan in order to connect up a SNES controller to a Pi Zero, but a question - I assume I can use a different BCM pin, and define that in the retrogame.c file if need be? Attached is a diagram of which pins my screen needs boxed in red - I assume I can move LEFT from pin 16 to 22, define it as such, and done?
Attachments
PiZeroPins.png
PiZeroPins.png (1012.72 KiB) Viewed 18039 times

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest