-
Notifications
You must be signed in to change notification settings - Fork 87
Interrupts
Alexander Hiam edited this page Dec 9, 2013
·
2 revisions
PyBBIO includes some basic digital interrupt functionality through [epoll](http://en.wikipedia.org/wiki/Epoll). This allows user functions to be automatically called when the kernel detects changes on any of the GPIO pins.
Applying voltages greater than 3.3v to the GPIO pins can cause permanent damage to your BeagleBone!
###Example programs:
PyBBIO/examples/interrupt.py
###Constants:
RISING - Specifies rising edge interrupt; equal to 1.
FALLING - Specifies falling edge interrupt; equal to -1.
BOTH - Specifies interrupt on either edge; equal to 0.
###Functions:
#####attachInterrupt(gpio_pin, callback, edge=BOTH)
Sets an interrupt on the specified pin. 'edge' can be RISING, FALLING, or BOTH. 'callback' is a function to be called each time an event is triggered.
#####detachInterrupt(gpio_pin)
Detaches the interrupt from the given pin if one is set.