The following code responds with "On" and "Off" only when the port is P8_12
or P8_11. With P8_7 or P8_9, it responds with "On" and never says "Off".
Why?
import Adafruit_BBIO.GPIO as GPIO # load library
import time # load time library
GPIO.setup("P8_11", GPIO.IN) # set pin as input
while True:
if GPIO.input("P8_11"): # if alarm is high
print "On" # act on it
time.sleep(.1)
while GPIO.input("P8_11"): #wait for alarm to go inactive
time.sleep(.1)
print "Off"
time.sleep(.01) # do nothing
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.