Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions adafruit_sgp30.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

# pylint: disable=bad-whitespace
_SGP30_DEFAULT_I2C_ADDR = const(0x58)
_SGP30_FEATURESET = const(0x0020)
_SGP30_FEATURESETS = (0x0020, 0x0022)

_SGP30_CRC8_POLYNOMIAL = const(0x31)
_SGP30_CRC8_INIT = const(0xFF)
Expand All @@ -71,7 +71,7 @@ def __init__(self, i2c, address=_SGP30_DEFAULT_I2C_ADDR):
self.serial = self._i2c_read_words_from_cmd([0x36, 0x82], 0.01, 3)
# get featureset
featureset = self._i2c_read_words_from_cmd([0x20, 0x2f], 0.01, 1)
if featureset[0] != _SGP30_FEATURESET:
if featureset[0] not in _SGP30_FEATURESETS:
raise RuntimeError('SGP30 Not detected')
self.iaq_init()

Expand Down