Retrogaming with RPI - Buttons

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Adisma
 
Posts: 3
Joined: Sun Aug 24, 2014 5:50 pm

Retrogaming with RPI - Buttons

Post by Adisma »

Hi,

I have a question about the Adding arcade buttons tutorial.
If I read it well, the buttons are connected to 1 GPIO et to the GND, correct ?

In every other tutorials, how-to... buttons needs to be connected to the 3.3V (with 1/2 resistors), to GPIO and to GND.. How the pi can read an "unplugged" button ?


Thanks for the help

User avatar
egutting
 
Posts: 297
Joined: Wed Nov 14, 2012 12:57 am

Re: Retrogaming with RPI - Buttons

Post by egutting »

I'm not completely sure (pburgess probably can give you a better answer), but I would think that the Pi may be looking for a falling interrupt and attaching an action to it. Kind of similar to this blog post:
http://www.adafruit.com/blog/2013/03/29 ... io-part-3/

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Retrogaming with RPI - Buttons

Post by adafruit_support_mike »

The RasPi's GPIO pins have built-in pull-up resistors. If you tell the microprocessor to use the pull-ups, you don't need an external resistor.

User avatar
Adisma
 
Posts: 3
Joined: Sun Aug 24, 2014 5:50 pm

Re: Retrogaming with RPI - Buttons

Post by Adisma »

Thanks.
But in this tuto buttons are connected to 3.3v.

In adafruit arcade tuto they're only connected to gpio and ground..

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Retrogaming with RPI - Buttons

Post by adafruit_support_mike »

Like I said: the RasPi's GPIO pins have built-in pull-up resistors.

When you enable the pull-up, the chip makes the connection between the GPIO pin and 3.3v internally.

User avatar
Adisma
 
Posts: 3
Joined: Sun Aug 24, 2014 5:50 pm

Re: Retrogaming with RPI - Buttons

Post by Adisma »

Great ! Thanks :)
Do you know if the "retrogame" utility available in the tuto enables the pull-up resistor ? Or, is it a way to enable them by default ?
Ok, they are ^^

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”