1
\$\begingroup\$

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

\$\endgroup\$
3
  • \$\begingroup\$ What are the pins on the beaglebone? \$\endgroup\$ Mar 11 '13 at 22:47
  • \$\begingroup\$ Your commands to export, setup the direction, and read the pin is correct. Can you see the voltage changing with a DMM? Are you sure you are using the correct pin? Another way of checking your hardware is to remove your button, change the pin direction to an out and see if you can change the voltage (echo 1>value echo 0>value) on the button GPIO connection. \$\endgroup\$
    – spearson
    Mar 11 '13 at 22:56
  • \$\begingroup\$ I tried connecting a led and I got that blinking. The strange thing is that even after I disconnected everything, it still returned the value one. I wonder if I am doing it wrong on my diagram, can I be frying my gpios or would they not be able to output then? \$\endgroup\$
    – Tommyka
    Mar 12 '13 at 7:47
5
\$\begingroup\$

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.

\$\endgroup\$
3
  • \$\begingroup\$ Thanks of the edit. Now I better understand how pullup works :D \$\endgroup\$
    – Tommyka
    Mar 20 '13 at 10:29
  • \$\begingroup\$ How did you determine it had a pullup? I cannot find a good GPIO chart for the Beaglebone Black. \$\endgroup\$
    – taco
    May 13 '13 at 20:36
  • \$\begingroup\$ When i checked the pin without connecting anything to the gpio, and it still retured one. I asked a friend of mine who is a Electronic engineer and he suggested that it pulled up the value. \$\endgroup\$
    – Tommyka
    May 14 '13 at 7:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.