Just fixes an import failure. The module is still not, to my knowledge, in a working state.
20 lines
406 B
Python
20 lines
406 B
Python
import time
|
|
|
|
from board import SCL, SDA
|
|
import busio
|
|
|
|
import adafruit_ccs811
|
|
|
|
i2c_bus = busio.I2C(SCL, SDA)
|
|
|
|
ccs = adafruit_ccs811.CCS811(i2c_bus)
|
|
|
|
#wait for the sensor to be ready and calibrate the thermistor
|
|
while not ccs.data_ready:
|
|
pass
|
|
temp = ccs.temperature
|
|
ccs.temp_offset = temp - 25.0
|
|
|
|
while True:
|
|
print("CO2: ", ccs.eco2, " TVOC:", ccs.tvoc, " temp:", ccs.temperature)
|
|
time.sleep(.5)
|