Debounce, Service

This commit is contained in:
T
2026-06-25 23:44:49 +02:00
parent 5cb3252ae1
commit 95580bb3eb
3 changed files with 69 additions and 10 deletions
+5 -5
View File
@@ -298,20 +298,20 @@ def main():
door_sense.switch_to_input(digitalio.Pull.UP)
menu = StateMenu()
btn_locked = False
btn_locked = 0
try:
while True:
if not btn_oben.value:
if not btn_locked:
menu.button_pressed("oben")
btn_locked = True
btn_locked = 10
elif not btn_unten.value:
if not btn_locked:
menu.button_pressed("unten")
btn_locked = True
else:
btn_locked = False
btn_locked = 10
elif btn_locked:
btn_locked -= 1
if door_sense.value != menu.doors["unten"].door_sense_state:
menu.doors["unten"].door_sense_state = door_sense.value