1
\$\begingroup\$

I tried out the the BBB with the Adafruit python library.

I was connecting a Voltmeter to the right Pin and run the following program

 import Adafruit_BBIO.GPIO as GPIO
 import time
 pin = "P8_10"

 GPIO.setup(pin, GPIO.OUT)

 for x in range(0,5):
     print("High")
     GPIO.output(pin,GPIO.HIGH)
     time.sleep(1)
     print("Low")
     GPIO.output(pin,GPIO.LOW)
     time.sleep(1)

 GPIO.cleanup()

Unfortunalty it was always on high, I did try a 1kOhm pulldown resistor to the ground. Still the same always high.

I did try the it the other way using this code:

 import Adafruit_BBIO.GPIO as GPIO
 import time
 pin = "P8_10"

 print("Setup " + pin)


 GPIO.setup(pin, GPIO.IN)
    for x in range(0,5):
            if GPIO.input(pin):
                    print("High")
            else:
                    print("Low")
            time.sleep(0.5)

 print("end")
 GPIO.cleanup()

Connecting it over a 1kOhm resistor to ground. I did still stay High all the time.

The OS on my BBB is Ubuntu. Any suggestions what could be wrong with the setup?

\$\endgroup\$
4
  • \$\begingroup\$ Just to be sure, the pin you are checking is 5 down, 1 over, correct? Also, are you running python as python your_script.py, or as sudo python your_script.py \$\endgroup\$
    – Passerby
    Oct 29, 2013 at 3:50
  • \$\begingroup\$ @Passerby I did run it in as a normal user, I'll try to run it as root tonight. I did use the most right pin 5 from the top if you count the first as one. I also tried all the surrounding ones to be sure and also different other pins (and also altering the pin var of course) \$\endgroup\$
    – magu_
    Oct 29, 2013 at 7:32
  • \$\begingroup\$ I suppose sudo didn't work? \$\endgroup\$
    – Passerby
    Oct 31, 2013 at 0:54
  • \$\begingroup\$ @Passerby, Yes and Yes - I didn't work \$\endgroup\$
    – magu_
    Oct 31, 2013 at 8:47

1 Answer 1

1
\$\begingroup\$

Based on the Adafruit Learn page for the library

The majority of this library will need to be run as sudo in Ubuntu.

this Stackoverflow question, and the Github Bug closure as it is by design required to be run as sudo or root, it should be an issue of not running the script as sudo.

\$\endgroup\$
2
  • \$\begingroup\$ Anything else, would be off topic for the EE stackexchange btw. It's essentially a linux/software question \$\endgroup\$
    – Passerby
    Oct 31, 2013 at 1:04
  • \$\begingroup\$ I tried sudo with no success unfortunatly... \$\endgroup\$
    – magu_
    Oct 31, 2013 at 8:47

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.