Use the driver from here: https://github.com/alexmrqt/micropython-sgp30
modify line 54 from
Code: Select all
_SGP30_FEATURESET = const(0x0020)
Code: Select all
_SGP30_FEATURESET = const(0x0022)
Code: Select all
import machine
import adafruit_sgp30
i2c = machine.I2C(scl=machine.Pin(5), sda=machine.Pin(4), freq=100000)
i2c.init(scl=machine.Pin(5), sda=machine.Pin(4))
sgp30 = adafruit_sgp30.Adafruit_SGP30(i2c)
co2eq, tvoc = sgp30.iaq_measure()
print("CO2eq = %d ppm \t TVOC = %d ppb" % (co2eq, tvoc))