In the following code is the event polled by the Python process
running the code or is there something cleverer going on such that
Python sees an interrupt when the input goes high (or low)?



    import Adafruit_BBIO.GPIO as GPIO

    Pin = "P8_8"
    GPIO.setup(Pin, GPIO.IN)    # set GPIO25 as input (button)

    def my_callback(channel):
        if GPIO.input(Pin):
            print "Rising edge detected on 25"
        else:                  # if port 25 != 1
            print "Falling edge detected on 25"

    GPIO.add_event_detect(Pin, GPIO.BOTH, my_callback, 1)


-- 
Chris Green
ยท
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to