Created
January 4, 2021 08:51
-
-
Save janjagusch/f5e1c4c0543e11c150581b90c90c5bb7 to your computer and use it in GitHub Desktop.
Adafruit CircuitPython CCS811 Drive Mode Test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
https://github.com/adafruit/Adafruit_CircuitPython_CCS811/issues/43 | |
""" | |
import time | |
import board | |
import busio | |
import adafruit_ccs811 | |
i2c = busio.I2C(board.SCL, board.SDA) | |
ccs811 = adafruit_ccs811.CCS811(i2c) | |
# Adjust drive mode | |
# Now measurement should only change every 10 seconds. | |
ccs811.drive_mode = adafruit_ccs811.DRIVE_MODE_10SEC | |
# Wait for the sensor to be ready | |
while not ccs811.data_ready: | |
pass | |
while True: | |
print("CO2: {} PPM, TVOC: {} PPB".format(ccs811.eco2, ccs811.tvoc)) | |
time.sleep(0.5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment