acmepins.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:TanzoBot 作者: tanzilli 项目源码 文件源码
def add_event_detect(pin, value, callback, debouncingtime):
    iopath=get_gpio_path(pinname2kernelid(pin))
    if os.path.exists(iopath): 
        fd = open(iopath + '/value','w')
        fd.write(str(value))
    else:
        return

    kernel_id=pinname2kernelid(pin)
    if fd!=None:
        set_edge(kernel_id,value)
        thread.start_new_thread(wait_edge,(fd,pin,callback,debouncingtime))
        return
    else:       
        thread.exit()

    fd.close()


#End of RPi.GPIO wrapper functions
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号