Skip to content

Commit

Permalink
Merge pull request #36 from FoamyGuy/sleep_after_reset
Browse files Browse the repository at this point in the history
sleep after reset before read register
  • Loading branch information
FoamyGuy committed Apr 17, 2023
2 parents 318333e + f1eb01e commit 4c18043
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions adafruit_si7021/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
"""
import struct
import time

from adafruit_bus_device.i2c_device import I2CDevice
from micropython import const
Expand Down Expand Up @@ -137,6 +138,12 @@ class SI7021:
def __init__(self, i2c_bus: I2C, address: int = 0x40) -> None:
self.i2c_device = I2CDevice(i2c_bus, address)
self._command(_RESET)

# max 15ms Powerup Time after issuing software reset
# Table 2 inside of:
# https://cdn-learn.adafruit.com/assets/assets/000/035/931/original/Support_Documents_TechnicalDocs_Si7021-A20.pdf
time.sleep(0.015)

# Make sure the USER1 settings are correct.
while True:
# While restarting, the sensor doesn't respond to reads or writes.
Expand Down

0 comments on commit 4c18043

Please sign in to comment.