Skip to content

Added support for newer SGP30 chips which use a featureset value of 0x0022 #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 6, 2019
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