Skip to content

Commit

Permalink
vinscant: added watchdog timer
Browse files Browse the repository at this point in the history
  • Loading branch information
draxaris1010 authored and hannes-dev committed Jun 10, 2024
1 parent 20a68a7 commit 551a150
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion vinscant/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import mfrc522
import urequests as req
from machine import Pin, PWM
from machine import Pin, PWM, WDT
import time
from neopixel import NeoPixel

Expand Down Expand Up @@ -109,11 +109,17 @@ def do_read():
print("Authentication error")
notifier.error()
notifier.idle()
watchdog.feed()
except KeyboardInterrupt:
print("KeyboardInterrupt")

return

notifier = StatusNotifier(Buzzer(Pin(37, Pin.OUT)), Led())
notifier.idle()
key = get_key()
print("vinscant: watchdog starting in 2s, interupt now with Ctrl+C")
time.sleep(2)
watchdog = WDT(timeout=10 * 1000)
print("vinscant: watchdog started")
do_read()

0 comments on commit 551a150

Please sign in to comment.