Am attempting to use one of the GPIO pins as an input to detect a button push and it is just not working.
Have read thru 100+ postings here and just as many tutorials and have used multiple GPIO ports to attempt this.
Have no issues controlling OUT setup and driving relays, LEDs etc.
From 2015-11-21-raspbian-jessie I issue the following commands:
echo 20 > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio20/direction
Then I use cat /sys/class/gpio/gpio20/value to get the current value 0 or 1.
I have tried a button wired in the following configurations:
From Ground thru button and 330 ohm resistor to GPIO pin.
From 3.3v thru button and 330 ohm resistor to GPIO pin.
From Ground thru button to GPIO pin directly.
From 3.3v thru button to GPIO pin directly.
Tried all four with pullup and pulldown.
When pressed or unpressed the value for the GPIO is always 0.
I cant figure out what I am missing. I have a degree in electronics and am probably overthinking it.
PS: Yes I checked the switch. Below is the circuit I am emulating.
http://raspberry.io/media/images/projec ... _schem.png