From fcb02be41261ede520aba1b9885c49d23d08764f Mon Sep 17 00:00:00 2001 From: Thomas Farstrike Date: Wed, 23 Apr 2025 22:39:06 +0200 Subject: [PATCH] Proper temperature --- apps/com.example.imu/assets/main.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/com.example.imu/assets/main.py b/apps/com.example.imu/assets/main.py index fbd4a5c0..964d59aa 100644 --- a/apps/com.example.imu/assets/main.py +++ b/apps/com.example.imu/assets/main.py @@ -39,8 +39,7 @@ canary.add_flag(0x0001) # LV_OBJ_FLAG_HIDDEN is 0x0001 while canary.get_class(): #print(f"""{sensor.temperature=} {sensor.acceleration=} {sensor.gyro=}""") - temp = int(sensor.temperature * 100) - templabel.set_text(f"Temperature: {temp}") + templabel.set_text(f"Temperature: {sensor.temperature:.2f}") ax = sensor.acceleration[0] axp = int((ax * 100 + 100)/2) ay = sensor.acceleration[1]