Files
loustique-home/composants/byPanda/septsegments.py
2026-04-01 18:39:00 +02:00

22 lines
624 B
Python

import tm1637
import time as t
_display = None
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}")
try:
temp1 = int(temperature)
temp2 = int(temperature_moyenne)
texte_ecran = f"{temp1:02d}{temp2:02d}"
disp = get_display()
disp.show(texte_ecran)
except Exception as e:
print(f"Erreur d'affichage : {e}")