def main():
GPIO.setmode(GPIO.BCM)
GPIO.setup(reset_switch, GPIO.IN, pull_up_down = GPIO.PUD_UP)
GPIO.setup(hook_switch, GPIO.IN, pull_up_down = GPIO.PUD_UP)
GPIO.add_event_detect(reset_switch, GPIO.BOTH, callback = _io_pulsed, bouncetime = 200)
GPIO.add_event_detect(hook_switch, GPIO.BOTH, callback = _io_pulsed, bouncetime = 200)
while True:
time.sleep(1000)
评论列表
文章目录