Skip to content

Improving docs #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion adafruit_sgp30.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

**Software and Dependencies:**

* Adafruit CircuitPython firmware for the ESP8622 and M0-based boards:
* Adafruit CircuitPython firmware for the supported boards:
https://github.com/adafruit/circuitpython/releases
* Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
"""
Expand All @@ -43,6 +43,40 @@
class Adafruit_SGP30:
"""
A driver for the SGP30 gas sensor.

:param ~busio.I2C i2c: The I2C bus the SGP30 is connected to.
:param int address: The I2C address of the device. Defaults to :const:`0x58`


**Quickstart: Importing and using the SGP30 temperature sensor**

Here is one way of importing the `Adafruit_SGP30` class so you
can use it with the name ``sgp30``.
First you will need to import the libraries to use the sensor

.. code-block:: python

import busio
import board
import adafruit_sgp30

Once this is done you can define your `busio.I2C` object and define your sensor object

.. code-block:: python

i2c = busio.I2C(board.SCL, board.SDA, frequency=100000)
sgp30 = adafruit_sgp30.Adafruit_SGP30(i2c)

Now you have access to the Carbon Dioxide Equivalent baseline using the
:attr:`baseline_eCO2` attribute and the Total Volatile Organic Compound
baseline using the :attr:`baseline_TVOC`

.. code-block:: python

eCO2 = sgp30.baseline_eCO2
TVOC = sgp30.baseline_TVOC


"""

def __init__(self, i2c, address=_SGP30_DEFAULT_I2C_ADDR):
Expand Down