def main():
try:
GPIO.add_event_detect(PIR_PIN, GPIO.BOTH, callback=interrupt_event, bouncetime=100)
#keep script running
signal.pause()
except KeyboardInterrupt: # does not work if it runs in background.
print "\nQuit"
评论列表
文章目录