def edge_detect(pin, event_callback, bounce):
 import Adafruit_BBIO.GPIO as GPIO
 GPIO.add_event_detect(pin, GPIO.BOTH, callback=event_callback, bouncetime=bounce)

def edge_detect ( pin , event_callback , bounce ) : import Adafruit_BBIO . GPIO as GPIO GPIO . add_event_detect ( pin , GPIO . BOTH , callback = event_callback , bouncetime = bounce )
add detection for rising and falling events .