ccs811_simpletest.py
1 import time 2 import board 3 import busio 4 import adafruit_ccs811 5 6 i2c = busio.I2C(board.SCL, board.SDA) 7 ccs811 = adafruit_ccs811.CCS811(i2c) 8 9 # Wait for the sensor to be ready 10 while not ccs811.data_ready: 11 pass 12 13 while True: 14 print("CO2: {} PPM, TVOC: {} PPB".format(ccs811.eco2, ccs811.tvoc)) 15 time.sleep(0.5)