mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
Increase temperature precision
This commit is contained in:
@@ -37,7 +37,7 @@ def map_nonlinear(value: float) -> int:
|
||||
import time
|
||||
while appscreen == lv.screen_active():
|
||||
#print(f"""{sensor.temperature=} {sensor.acceleration=} {sensor.gyro=}""")
|
||||
templabel.set_text(f"Temperature: {sensor.temperature:.2f}")
|
||||
templabel.set_text(f"Temperature: {sensor.temperature:.2f}°C")
|
||||
ax = sensor.acceleration[0]
|
||||
axp = int((ax * 100 + 100)/2)
|
||||
ay = sensor.acceleration[1]
|
||||
|
||||
@@ -84,7 +84,7 @@ def add_notification_bar(screen):
|
||||
time_label.align(lv.ALIGN.LEFT_MID, 0, 0)
|
||||
time_label.set_style_text_color(COLOR_TEXT_WHITE, 0)
|
||||
temp_label = lv.label(notification_bar)
|
||||
temp_label.set_text("00°C")
|
||||
temp_label.set_text("00.00°C")
|
||||
temp_label.align_to(time_label, lv.ALIGN.OUT_RIGHT_MID, PADDING_TINY, 0)
|
||||
temp_label.set_style_text_color(COLOR_TEXT_WHITE, 0)
|
||||
memfree_label = lv.label(notification_bar)
|
||||
@@ -136,7 +136,7 @@ def add_notification_bar(screen):
|
||||
print("update_wifi_icon caught LvReferenceError")
|
||||
import esp32
|
||||
def update_temperature(timer):
|
||||
temp_label.set_text(f"{esp32.mcu_temperature()}°C")
|
||||
temp_label.set_text(f"{esp32.mcu_temperature():.2f}°C")
|
||||
import gc
|
||||
def update_memfree(timer):
|
||||
gc.collect()
|
||||
|
||||
Reference in New Issue
Block a user