I am reading a hall sensor output in beaglebone gpio pin, for every rising edge the interrupt service routine needs to execute. So, how to use external interrupt in beaglebone? and is there any standard driver for this purpose?
Thanks.
Yes there is a standard driver. This page here shows the basic steps for using gpio's.
In Python using Adafruit Libray,
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)
Here is reference link.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With