pi_power.py 文件源码

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

项目:pi_power 作者: craic 项目源码 文件源码
def user_shutdown_setup(shutdown_pin):
    # setup the pin to check the shutdown switch - use the internal pull down resistor
    GPIO.setup(shutdown_pin, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)

    # create a trigger for the shutdown switch
    GPIO.add_event_detect(shutdown_pin, GPIO.RISING, callback=user_shutdown, bouncetime=1000)

# User has pressed shutdown button - initiate a clean shutdown
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号