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

16 lines
382 B
Python
Raw Normal View History

2026-03-30 22:10:28 +02:00
import tm1637
import time as t
2026-03-30 23:17:08 +02:00
display = tm1637.TM1637(clk=4, dio=17)
display.brightness(2)
2026-03-30 22:10:28 +02:00
def afficher_temperature(temperature):
2026-03-30 23:17:08 +02:00
print(f"Test affichage: {temperature}")
2026-03-30 22:10:28 +02:00
try:
2026-03-30 23:17:08 +02:00
temp_entiere = int(temperature)
texte_ecran = f"{temp_entiere} C"
display.show(texte_ecran)
except Exception as e:
print(f"Erreur d'affichage : {e}")