Files
loustique-home/composants/byPanda/board1main.py

24 lines
557 B
Python
Raw Normal View History

2026-03-27 13:33:32 +01:00
import time
2026-04-02 22:20:07 +02:00
import threading
import alarme
2026-03-27 13:33:32 +01:00
from porterfid import SystemePorteRFID
2026-04-02 22:20:07 +02:00
import RPi.GPIO as GPIO
2026-03-27 13:33:32 +01:00
porte = SystemePorteRFID()
2026-04-02 22:20:07 +02:00
def call_board1():
thread_alarme = threading.Thread(target=alarme.boucle_principale, daemon=True)
thread_alarme.start()
2026-03-27 13:33:32 +01:00
2026-04-02 22:20:07 +02:00
print("[BOARD 1] Système d'alarme lancé en arrière-plan.")
2026-04-01 22:23:25 +02:00
2026-04-01 15:54:46 +02:00
try:
while True:
porte.mettreAJour()
2026-04-02 22:20:07 +02:00
time.sleep(0.3)
2026-03-27 13:33:32 +01:00
2026-04-01 15:54:46 +02:00
except KeyboardInterrupt:
print("\nArrêt manuel du programme.")
finally:
porte.cleanup()
2026-04-02 22:20:07 +02:00
GPIO.cleanup()