Maj 7segment
This commit is contained in:
@@ -1,18 +1,17 @@
|
|||||||
import tm1637
|
import tm1637
|
||||||
import time as t
|
import time as t
|
||||||
|
|
||||||
|
|
||||||
display = tm1637.TM1637(clk=4, dio=17)
|
display = tm1637.TM1637(clk=4, dio=17)
|
||||||
display.brightness(2)
|
display.brightness(2)
|
||||||
|
|
||||||
def afficher_temperature(temperature,temperature_moyenne):
|
def afficher_temperature(temperature, temperature_moyenne):
|
||||||
print(f"Test affichage: {temperature}")
|
print(f"Test affichage: Cible {temperature} | Moyenne {temperature_moyenne}")
|
||||||
try:
|
try:
|
||||||
temp_entiere = int(temperature)
|
temp1 = int(temperature)
|
||||||
texte_ecran = f"{temp_entiere}{temperature_moyenne}"
|
temp2 = int(temperature_moyenne)
|
||||||
|
texte_ecran = f"{temp1:02d}{temp2:02d}"
|
||||||
|
|
||||||
display.show(texte_ecran)
|
display.show(texte_ecran)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Erreur d'affichage : {e}")
|
print(f"Erreur d'affichage : {e}")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user