Skip to content

Commit 4c18043

Browse files
authored
Merge pull request #36 from FoamyGuy/sleep_after_reset
sleep after reset before read register
2 parents 318333e + f1eb01e commit 4c18043

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

adafruit_si7021/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
* Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
2626
"""
2727
import struct
28+
import time
2829

2930
from adafruit_bus_device.i2c_device import I2CDevice
3031
from micropython import const
@@ -137,6 +138,12 @@ class SI7021:
137138
def __init__(self, i2c_bus: I2C, address: int = 0x40) -> None:
138139
self.i2c_device = I2CDevice(i2c_bus, address)
139140
self._command(_RESET)
141+
142+
# max 15ms Powerup Time after issuing software reset
143+
# Table 2 inside of:
144+
# https://cdn-learn.adafruit.com/assets/assets/000/035/931/original/Support_Documents_TechnicalDocs_Si7021-A20.pdf
145+
time.sleep(0.015)
146+
140147
# Make sure the USER1 settings are correct.
141148
while True:
142149
# While restarting, the sensor doesn't respond to reads or writes.

0 commit comments

Comments
 (0)