Files
loustique-home/composants/byPanda/board1main.py
2026-04-03 18:35:33 +02:00

24 lines
557 B
Python

import time
import threading
import alarme
from porterfid import SystemePorteRFID
import RPi.GPIO as GPIO
porte = SystemePorteRFID()
def call_board1():
thread_alarme = threading.Thread(target=alarme.boucle_principale, daemon=True)
thread_alarme.start()
print("[BOARD 1] Système d'alarme lancé en arrière-plan.")
try:
while True:
porte.mettreAJour()
time.sleep(0.3)
except KeyboardInterrupt:
print("\nArrêt manuel du programme.")
finally:
porte.cleanup()
GPIO.cleanup()