@@ -63,6 +63,7 @@ def adjust_to_sea_pressure(pressure_hpa, temperature, altitude):
63
63
64
64
def describe_pressure (pressure_hpa ):
65
65
"""Convert pressure into barometer-type description."""
66
+ pressure_hpa += 0.5
66
67
if pressure_hpa < 970 :
67
68
description = "storm"
68
69
elif 970 <= pressure_hpa < 990 :
@@ -80,6 +81,7 @@ def describe_pressure(pressure_hpa):
80
81
81
82
def describe_humidity (corrected_humidity ):
82
83
"""Convert relative humidity into good/bad description."""
84
+ corrected_humidity += 0.5
83
85
if 40 < corrected_humidity < 60 :
84
86
description = "good"
85
87
else :
@@ -89,6 +91,7 @@ def describe_humidity(corrected_humidity):
89
91
90
92
def describe_light (lux ):
91
93
"""Convert light level in lux to descriptive value."""
94
+ lux += 0.5
92
95
if lux < 50 :
93
96
description = "dark"
94
97
elif 50 <= lux < 100 :
@@ -186,7 +189,7 @@ def draw_hist(results_array):
186
189
time .sleep (0.5 )
187
190
188
191
while True :
189
- # turn off the backlight with A and turn it back on with B
192
+ # turn on the backlight with A and turn it back off with B
190
193
# switch between sensor and equaliser mode with X and Y
191
194
if button_a .is_pressed :
192
195
display .set_backlight (BRIGHTNESS )
@@ -263,7 +266,7 @@ def draw_hist(results_array):
263
266
display .set_pen (RED )
264
267
if corrected_temperature < 10 :
265
268
display .set_pen (CYAN )
266
- 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 )
267
270
268
271
# draw temp max and min
269
272
display .set_pen (CYAN )
@@ -275,7 +278,7 @@ def draw_hist(results_array):
275
278
display .set_pen (WHITE )
276
279
display .text (f"rh { corrected_humidity :.0f} %" , 0 , 75 , WIDTH , scale = 3 )
277
280
display .text (f"{ pressure_hpa :.0f} hPa" , 0 , 125 , WIDTH , scale = 3 )
278
- display .text (f"{ lux } lux" , 0 , 175 , WIDTH , scale = 3 )
281
+ display .text (f"{ lux :.0f } lux" , 0 , 175 , WIDTH , scale = 3 )
279
282
280
283
# draw the second column of text
281
284
display .text (f"{ describe_humidity (corrected_humidity )} " , 125 , 75 , WIDTH , scale = 3 )
0 commit comments