@@ -52,31 +52,29 @@ class SPS30_I2C(SPS30):
52
52
53
53
**Quickstart: Importing and using the SCD30**
54
54
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.
58
56
First you will need to import the libraries to use the sensor
59
57
60
58
.. code-block:: python
61
59
62
60
import board
63
- import adafruit_sps30
61
+ from adafruit_sps30.i2c import SPS30_I2C
64
62
65
63
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.
66
66
67
67
.. code-block:: python
68
68
69
69
i2c = board.I2C() # uses board.SCL and board.SDA
70
- sps = adafruit_sps30.SPS30 (i2c)
70
+ sps = SPS30_I2C (i2c)
71
71
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`
74
74
75
75
.. code-block:: python
76
76
77
- temperature = scd.temperature
78
- relative_humidity = scd.relative_humidity
79
- co2_ppm_level = scd.CO2
77
+ aqdata = sps.read()
80
78
81
79
"""
82
80
@@ -185,7 +183,7 @@ def _scrunch_buffer(self, raw_data_len):
185
183
def _read_parse_data (self , output ):
186
184
self ._scrunch_buffer (self ._m_total_size )
187
185
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
189
187
for k , v in zip (self .FIELD_NAMES ,
190
188
unpack_from (self ._m_fmt , self ._buffer )):
191
189
output [k ] = v
0 commit comments