maj de 18h38
This commit is contained in:
@@ -19,7 +19,7 @@ class SystemePorteRFID:
|
||||
Gère le lecteur RFID et la LED de la porte.
|
||||
L'authentification est maintenant gérée par le serveur Flask et MariaDB.
|
||||
"""
|
||||
self.pinLed = 21
|
||||
self.pinLed = 4
|
||||
GPIO.setup(self.pinLed, GPIO.OUT, initial=GPIO.LOW)
|
||||
|
||||
self.lecteur = SimpleMFRC522()
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
import tm1637
|
||||
import time as t
|
||||
_display = None
|
||||
|
||||
display = tm1637.TM1637(clk=4, dio=17)
|
||||
display.brightness(2)
|
||||
def get_display():
|
||||
global _display
|
||||
if _display is None:
|
||||
_display = tm1637.TM1637(clk=4, dio=17)
|
||||
_display.brightness(2)
|
||||
return _display
|
||||
|
||||
def afficher_temperature(temperature, temperature_moyenne):
|
||||
print(f"Test affichage: Cible {temperature} | Moyenne {temperature_moyenne}")
|
||||
@@ -10,8 +15,8 @@ def afficher_temperature(temperature, temperature_moyenne):
|
||||
temp1 = int(temperature)
|
||||
temp2 = int(temperature_moyenne)
|
||||
texte_ecran = f"{temp1:02d}{temp2:02d}"
|
||||
|
||||
display.show(texte_ecran)
|
||||
disp = get_display()
|
||||
disp.show(texte_ecran)
|
||||
|
||||
except Exception as e:
|
||||
print(f"Erreur d'affichage : {e}")
|
||||
Reference in New Issue
Block a user