From 1e6e68356a931f9eee556c182d55a611a807d19f Mon Sep 17 00:00:00 2001 From: Angus Logan Date: Fri, 23 Jun 2023 20:27:10 +0100 Subject: [PATCH] Add rounding to lux report to prevent unit being overwritten Correct unit for centigrade --- micropython/examples/pico_enviro/enviro_all.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/micropython/examples/pico_enviro/enviro_all.py b/micropython/examples/pico_enviro/enviro_all.py index fc27cb4d..8249bd4b 100644 --- a/micropython/examples/pico_enviro/enviro_all.py +++ b/micropython/examples/pico_enviro/enviro_all.py @@ -266,7 +266,7 @@ while True: display.set_pen(RED) if corrected_temperature < 10: display.set_pen(CYAN) - display.text(f"{corrected_temperature:.1f}°c", 5, 15, WIDTH, scale=4) + display.text(f"{corrected_temperature:.1f}°C", 5, 15, WIDTH, scale=4) # draw temp max and min display.set_pen(CYAN) @@ -278,7 +278,7 @@ while True: display.set_pen(WHITE) display.text(f"rh {corrected_humidity:.0f}%", 0, 75, WIDTH, scale=3) display.text(f"{pressure_hpa:.0f}hPa", 0, 125, WIDTH, scale=3) - display.text(f"{lux} lux", 0, 175, WIDTH, scale=3) + display.text(f"{lux:.0f} lux", 0, 175, WIDTH, scale=3) # draw the second column of text display.text(f"{describe_humidity(corrected_humidity)}", 125, 75, WIDTH, scale=3)