I'm trying to test the following simple "blink" RPi.GPIO Python script.
import RPi.GPIO as GPIO LED_PIN = 18 # GPIO 18, (P1 pin 12) print 'A' GPIO.setmode(GPIO.BCM) # Broadcom pin-numbering scheme print 'B' GPIO.setup(LED_PIN, GPIO.OUT) # LED pin output print 'C' GPIO.output(LED_PIN, GPIO.LOW) # LED off while 1: print 'D' GPIO.output(LED_PIN, GPIO.HIGH) time.sleep(1) print 'E' GPIO.output(LED_PIN, GPIO.LOW) time.sleep(1)
When I run this, I get the output:
then the program appears to exit when it tries to call
GPIO.setup(...), but no error or segfault is shown. Since there's no error message, I'm quite bewildered and not quite sure where to go from here.
What's wrong with my script? What would be causing GPIO.setup() to fail?
I'm running Ubuntu 14.04. Please don't recommend that I use Raspbian.