Skip to content

Commit df35a53

Browse files
author
Kevin J Walters
committed
Finishing example in documentation.
1 parent 0a4e0a9 commit df35a53

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

adafruit_sps30/i2c.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,31 +52,29 @@ class SPS30_I2C(SPS30):
5252
5353
**Quickstart: Importing and using the SCD30**
5454
55-
TODO - note physical setup with grounding the interface pin
56-
57-
Here is an example of using the :class:`SCD30` class.
55+
Here is an example of using the :class:`SPS30` class.
5856
First you will need to import the libraries to use the sensor
5957
6058
.. code-block:: python
6159
6260
import board
63-
import adafruit_sps30
61+
from adafruit_sps30.i2c import SPS30_I2C
6462
6563
Once this is done you can define your `board.I2C` object and define your sensor object
64+
using the i2c bus.
65+
The SPS30 i2c mode is selected by grounding its interface pin.
6666
6767
.. code-block:: python
6868
6969
i2c = board.I2C() # uses board.SCL and board.SDA
70-
sps = adafruit_sps30.SPS30(i2c)
70+
sps = SPS30_I2C(i2c)
7171
72-
TODO Now you have access to the CO2, temperature and humidity using
73-
the :attr:`CO2`, :attr:`temperature` and :attr:`relative_humidity` attributes
72+
Now you have access to the air quality data using the class function
73+
`adafruit_sps30.SPS30.read`
7474
7575
.. code-block:: python
7676
77-
temperature = scd.temperature
78-
relative_humidity = scd.relative_humidity
79-
co2_ppm_level = scd.CO2
77+
aqdata = sps.read()
8078
8179
"""
8280

@@ -185,7 +183,7 @@ def _scrunch_buffer(self, raw_data_len):
185183
def _read_parse_data(self, output):
186184
self._scrunch_buffer(self._m_total_size)
187185

188-
# buffer will be longer than the data hence use of unpack_from
186+
# buffer will be longer than the data hence the use of unpack_from
189187
for k, v in zip(self.FIELD_NAMES,
190188
unpack_from(self._m_fmt, self._buffer)):
191189
output[k] = v

0 commit comments

Comments
 (0)