File tree Expand file tree Collapse file tree 1 file changed +35
-1
lines changed Expand file tree Collapse file tree 1 file changed +35
-1
lines changed Original file line number Diff line number Diff line change 2020
2121**Software and Dependencies:**
2222
23- * Adafruit CircuitPython firmware for the ESP8622 and M0-based boards:
23+ * Adafruit CircuitPython firmware for the supported boards:
2424 https://github.com/adafruit/circuitpython/releases
2525* Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
2626"""
4343class Adafruit_SGP30 :
4444 """
4545 A driver for the SGP30 gas sensor.
46+
47+ :param ~busio.I2C i2c: The I2C bus the SGP30 is connected to.
48+ :param int address: The I2C address of the device. Defaults to :const:`0x58`
49+
50+
51+ **Quickstart: Importing and using the SGP30 temperature sensor**
52+
53+ Here is one way of importing the `Adafruit_SGP30` class so you
54+ can use it with the name ``sgp30``.
55+ First you will need to import the libraries to use the sensor
56+
57+ .. code-block:: python
58+
59+ import busio
60+ import board
61+ import adafruit_sgp30
62+
63+ Once this is done you can define your `busio.I2C` object and define your sensor object
64+
65+ .. code-block:: python
66+
67+ i2c = busio.I2C(board.SCL, board.SDA, frequency=100000)
68+ sgp30 = adafruit_sgp30.Adafruit_SGP30(i2c)
69+
70+ Now you have access to the Carbon Dioxide Equivalent baseline using the
71+ :attr:`baseline_eCO2` attribute and the Total Volatile Organic Compound
72+ baseline using the :attr:`baseline_TVOC`
73+
74+ .. code-block:: python
75+
76+ eCO2 = sgp30.baseline_eCO2
77+ TVOC = sgp30.baseline_TVOC
78+
79+
4680 """
4781
4882 def __init__ (self , i2c , address = _SGP30_DEFAULT_I2C_ADDR ):
You can’t perform that action at this time.
0 commit comments