Skip to content

Commit 1e6e683

Browse files
committed
Add rounding to lux report to prevent unit being overwritten
Correct unit for centigrade
1 parent d25c695 commit 1e6e683

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

micropython/examples/pico_enviro/enviro_all.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def draw_hist(results_array):
266266
display.set_pen(RED)
267267
if corrected_temperature < 10:
268268
display.set_pen(CYAN)
269-
display.text(f"{corrected_temperature:.1f}°c", 5, 15, WIDTH, scale=4)
269+
display.text(f"{corrected_temperature:.1f}°C", 5, 15, WIDTH, scale=4)
270270

271271
# draw temp max and min
272272
display.set_pen(CYAN)
@@ -278,7 +278,7 @@ def draw_hist(results_array):
278278
display.set_pen(WHITE)
279279
display.text(f"rh {corrected_humidity:.0f}%", 0, 75, WIDTH, scale=3)
280280
display.text(f"{pressure_hpa:.0f}hPa", 0, 125, WIDTH, scale=3)
281-
display.text(f"{lux} lux", 0, 175, WIDTH, scale=3)
281+
display.text(f"{lux:.0f} lux", 0, 175, WIDTH, scale=3)
282282

283283
# draw the second column of text
284284
display.text(f"{describe_humidity(corrected_humidity)}", 125, 75, WIDTH, scale=3)

0 commit comments

Comments
 (0)