Simple test

Ensure your device works with this simple test.

examples/sgp40_simpletest.py
 1# SPDX-FileCopyrightText: 2020 by Bryan Siepert for Adafruit Industries
 2#
 3# SPDX-License-Identifier: Unlicense
 4import time
 5import board
 6import adafruit_sgp40
 7
 8# If you have a temperature sensor, like the bme280, import that here as well
 9# import adafruit_bme280
10
11i2c = board.I2C()  # uses board.SCL and board.SDA
12# i2c = board.STEMMA_I2C()  # For using the built-in STEMMA QT connector on a microcontroller
13sgp = adafruit_sgp40.SGP40(i2c)
14# And if you have a temp/humidity sensor, define the sensor here as well
15# bme280 = adafruit_bme280.Adafruit_BME280_I2C(i2c)
16
17while True:
18    print("Raw Gas: ", sgp.raw)
19    # Lets quickly grab the humidity and temperature
20    # temperature = bme280.temperature
21    # humidity = bme280.relative_humidity
22    # compensated_raw_gas = sgp.measure_raw(temperature = temperature, relative_humidity = humidity)
23    print("")
24    time.sleep(1)