Skip to content

Commit 515e28d

Browse files
committed
fix(wsen-hids): Added sleep_ms in comfort monitor example
1 parent cc384ac commit 515e28d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/wsen-hids/examples/comfort_monitor.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
"""Loop that reads humidity + temperature every 2s and prints a comfort indicator ("Dry", "Comfortable", "Humid") based on humidity thresholds (< 30%, 30-60%, > 60%)"""
22

3-
from time import sleep
3+
from time import sleep_ms
44

55
from machine import I2C
66
from wsen_hids import WSEN_HIDS
77

88
i2c = I2C(1)
99
sensor = WSEN_HIDS(i2c)
1010

11+
1112
def comfort_label(humidity):
1213
if humidity < 30:
1314
return "Dry"
@@ -25,4 +26,4 @@ def comfort_label(humidity):
2526
print("Comfort: {}".format(comfort))
2627
print()
2728

28-
sleep(2)
29+
sleep_ms(2000)

0 commit comments

Comments
 (0)