对于中断服务例程需要执行的每个上升沿,我正在读取beaglebone gpio引脚中的霍尔传感器输出。那么,如何在beaglebone中使用外部中断呢?有没有用于此目的的标准驱动程序?
谢谢。
发布于 2012-08-07 00:48:40
是的,有一个标准的驱动程序。本页here展示了使用gpio的基本步骤。
发布于 2018-06-13 12:45:07
在Python中使用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)这里是参考link。
https://stackoverflow.com/questions/11831590
复制相似问题