ankita
Posts: 2
Joined: Sat Oct 25, 2014 12:47 pm

Multiple GPIO input

Thu Oct 30, 2014 6:46 pm

Hello,

Please help me!
I want to program GPIO for 2 keys.
I connected a button with the GND and pin 24 and the other to GND and pin 20 are.
The key with 24 works well and output is as expected, but it happens nothing when I press button 20. Also, there are no errors when compiling.
Please take a look at the code , http://pastebin.com/RiDrfaXs

Any help is greatly appreciated!
thanks,

User avatar
joan
Posts: 14959
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Multiple GPIO input

Thu Oct 30, 2014 6:48 pm

Pin 20 is connected to ground. It is NOT a gpio.

User avatar
DougieLawson
Posts: 39297
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Multiple GPIO input

Thu Oct 30, 2014 7:35 pm

joan wrote:Pin 20 is connected to ground. It is NOT a gpio.
The OP's code is using BCM pin numbering. So GPIO24 is pin#18 and GPIO20 is pin#38.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Troubleshooting”