Skip to content

Commit 3f6fa28

Browse files
committed
Add 1 second sleep before retrying
1 parent 8ff0338 commit 3f6fa28

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

am2302.pyx

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ from libc.stdint cimport uint8_t
22
from libcpp cimport bool
33

44
cimport am2302
5+
import time
56

67
cdef bool _initialized = False
78

@@ -95,3 +96,6 @@ def read(pin=7, retries=10):
9596
temperature=reader.temperature,
9697
humidity=reader.humidity,
9798
)
99+
100+
# wait before checking sensor again
101+
time.sleep(1)

0 commit comments

Comments
 (0)