Skip to content

Commit b2567c9

Browse files
committed
examples: Use a single read() in temp_pressure_display wsen-pads.
1 parent 4a36a5c commit b2567c9

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

lib/wsen-pads/examples/temp_pressure_display.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ def bar_graph(value, vmin, vmax, width=20):
2828
return "[" + "#" * filled + "-" * (width - filled) + "]"
2929

3030
while True:
31-
temp = sensor.temperature()
32-
pressure = sensor.pressure_hpa()
33-
31+
pressure, temp = sensor.read()
3432
temp_bar = bar_graph(temp, TEMP_MIN, TEMP_MAX)
3533
press_bar = bar_graph(pressure, PRESS_MIN, PRESS_MAX)
3634

0 commit comments

Comments
 (0)