fixed some symboles gone wrong from copying
This commit is contained in:
@@ -26,9 +26,9 @@ def set_display(enable):
|
|||||||
|
|
||||||
|
|
||||||
def check_timeout():
|
def check_timeout():
|
||||||
if timer >= TIMEOUT and display:
|
if timer >= TIMEOUT and display:
|
||||||
set_display(False)
|
set_display(False)
|
||||||
elif not display and timer < TIMEOUT:
|
elif not display and timer < TIMEOUT:
|
||||||
set_display(True)
|
set_display(True)
|
||||||
|
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ if __name__ == "__main__":
|
|||||||
GPIO.add_event_detect(PIR_GPIO, GPIO.RISING, callback=motion)
|
GPIO.add_event_detect(PIR_GPIO, GPIO.RISING, callback=motion)
|
||||||
while True:
|
while True:
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
if timer < TIMEOUT:
|
if timer < TIMEOUT:
|
||||||
timer += 1
|
timer += 1
|
||||||
check_timeout()
|
check_timeout()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
|
Reference in New Issue
Block a user