Electronic – Beaglebone GPIO always return 1

beagleboardgpioswitches

I'm trying to get a button to work on my Beaglebone. I bought MAKE Volume 32 and tried to follow the guide in there.

But when I read the GPIO pin, do I always get 1.
I also tried to disconnect everything and is still got 1 from that pin.

I tried to read the value using the file systen as following

echo 70 > /sys/class/gpio/export

cd /sys/class/gpio/gpio70

echo in > direction

cat value

Here is my setup.

The resistor is a 10k resistor and the button is a arcade push button from Adafruit.

image diagram here

Best Answer

The pin has pullup, so when the switch pulls it to ground instead of 3.3v it functions well with the pullup. Before it was pulled to power and I was connecting it to power, so there was no measured difference.