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

Various user-contributed guides for hardware-related things
myPiZero
Posts: 30
Joined: Mon Aug 15, 2016 11:34 pm
Been thanked: 5 times

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

Post by myPiZero » Sat Sep 17, 2016 2:34 pm

As some of you maybe saw in my show-off forum post I used this method to wire the controls. The problem is that after a while some buttons stopped reacting. I verified that the GPIO pin of the malfunctioning buttons have failed (when I switched it to another pin and recompiled retrogame.c it worked again). By my opinion this method is unreliable because of the low integrity of the pins. I don't understand why they failed, but about 4 pins are more than can be repaired. I eventually wired it through an Arduino. It actually looks better now because the wires are a lot shorter. I just need to connect the USB.
Image

prerunnerseth
Posts: 279
Joined: Fri May 06, 2016 5:36 pm
Has thanked: 16 times
Been thanked: 229 times

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

Post by prerunnerseth » Mon Sep 19, 2016 10:05 am

myPiZero wrote:As some of you maybe saw in my show-off forum post I used this method to wire the controls. The problem is that after a while some buttons stopped reacting. I verified that the GPIO pin of the malfunctioning buttons have failed (when I switched it to another pin and recompiled retrogame.c it worked again). By my opinion this method is unreliable because of the low integrity of the pins. I don't understand why they failed, but about 4 pins are more than can be repaired. I eventually wired it through an Arduino. It actually looks better now because the wires are a lot shorter. I just need to connect the USB.
Image
I would verify completely before you make these statements. The Pins on the Pi Zero are made to be use this way. There is a weak pull up that holds the pin up and you pull it low with a button. There is no reason this will damage a pin. Retrogame is used on TONS of projects not just in GBZ builds. Mame cabinets and the such. I suspect you are doing something wrong to be damaging pins. My personal GBZ build is running this setup and is completely reliable.

Tim
Posts: 23
Joined: Sun Sep 04, 2016 5:24 am
Been thanked: 3 times

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

Post by Tim » Thu Sep 22, 2016 12:11 pm

Hey guys,

i did the tutorial exactly as shown but on Retropie 4.0. Everytime i do

Code: Select all

make retrogame
i just get an error message but i didn't change anything in the table so my problem can't be caused by this like it says in the tutorial. Can anyone please help me?

prerunnerseth
Posts: 279
Joined: Fri May 06, 2016 5:36 pm
Has thanked: 16 times
Been thanked: 229 times

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

Post by prerunnerseth » Thu Sep 22, 2016 12:43 pm

Tim wrote:Hey guys,

i did the tutorial exactly as shown but on Retropie 4.0. Everytime i do

Code: Select all

make retrogame
i just get an error message but i didn't change anything in the table so my problem can't be caused by this like it says in the tutorial. Can anyone please help me?
What is the error message?

Tim
Posts: 23
Joined: Sun Sep 04, 2016 5:24 am
Been thanked: 3 times

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

Post by Tim » Thu Sep 22, 2016 1:21 pm

It says

Code: Select all

make: warning: Clock skew detected. You build may be incomplete.
Attachments
IMG_4127.JPG
IMG_4127.JPG (1.27 MiB) Viewed 17583 times

myPiZero
Posts: 30
Joined: Mon Aug 15, 2016 11:34 pm
Been thanked: 5 times

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

Post by myPiZero » Thu Sep 22, 2016 2:27 pm

I believe you can ignore this message.
stackoverflow
That message is usually an indication that some of your files have modification times later than the current system time. Since make decides which files to compile when performing an incremental build by checking if a source files has been modified more recently than its object file, this situation can cause unnecessary files to be built, or worse, necessary files to not be built.

However, if you are building from scratch (not doing an incremental build) you can likely ignore this warning without consequence.

Tim
Posts: 23
Joined: Sun Sep 04, 2016 5:24 am
Been thanked: 3 times

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

Post by Tim » Fri Sep 23, 2016 8:05 am

Thanks! Got it working :D

Zero
Posts: 157
Joined: Fri Sep 02, 2016 6:32 pm
Location: Bristol, UK
Has thanked: 11 times
Been thanked: 35 times

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

Post by Zero » Fri Sep 23, 2016 8:28 am

If anyone ever has any problems with Adafruit's Retrogame software then there's an alternative that works really well called 'Gpioneer'. Takes a while to install but it's all automated and much easier to use. Info on how to install it here:

https://github.com/mholgatem/gpioneer

musty_666
Posts: 29
Joined: Tue Aug 16, 2016 8:34 am
Has thanked: 4 times
Been thanked: 2 times

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

Post by musty_666 » Wed Sep 28, 2016 1:48 am

Be careful with this! I found a guy that did a gameboy using the GPIO buttons instead of a teensy and because having GPIO handling the buttons and the audio, some buttons didn't work for him!

prerunnerseth
Posts: 279
Joined: Fri May 06, 2016 5:36 pm
Has thanked: 16 times
Been thanked: 229 times

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

Post by prerunnerseth » Wed Sep 28, 2016 7:40 am

musty_666 wrote:Be careful with this! I found a guy that did a gameboy using the GPIO buttons instead of a teensy and because having GPIO handling the buttons and the audio, some buttons didn't work for him!
This would only be an issue if you tried to map buttons to the GPIO pins used for PWM audio. I specifically avoided those pins in this version of retropie.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest