|
16 | 16 |
|
17 | 17 | **Hardware:** |
18 | 18 |
|
19 | | -* Adafruit `Sensiron SHT31-D Temperature & Humidity Sensor Breakout |
20 | | - <https://www.adafruit.com/product/2857>`_ (Product ID: 2857) |
| 19 | +* Adafruit SHT31-D temperature and humidity sensor Breakout: https://www.adafruit.com/product/2857 |
21 | 20 |
|
22 | 21 | **Software and Dependencies:** |
23 | 22 |
|
24 | | -* Adafruit CircuitPython firmware for the ESP8622 and M0-based boards: |
25 | | - https://github.com/adafruit/circuitpython/releases |
| 23 | +* Adafruit CircuitPython firmware for the supported boards: |
| 24 | + https://circuitpython.org/downloads |
| 25 | +
|
26 | 26 | * Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice |
27 | 27 | """ |
28 | 28 |
|
@@ -145,8 +145,35 @@ class SHT31D: |
145 | 145 | """ |
146 | 146 | A driver for the SHT31-D temperature and humidity sensor. |
147 | 147 |
|
148 | | - :param i2c_bus: The `busio.I2C` object to use. This is the only required parameter. |
149 | | - :param int address: (optional) The I2C address of the device. |
| 148 | + :param ~busio.I2C i2c_bus: The I2C bus the SHT31-D is connected to |
| 149 | + :param int address: (optional) The I2C address of the device. Defaults to :const:`0x44` |
| 150 | +
|
| 151 | + **Quickstart: Importing and using the SHT31-D** |
| 152 | +
|
| 153 | + Here is an example of using the :class:`SHT31D` class. |
| 154 | + First you will need to import the libraries to use the sensor |
| 155 | +
|
| 156 | + .. code-block:: python |
| 157 | +
|
| 158 | + import board |
| 159 | + import adafruit_sht31d |
| 160 | +
|
| 161 | + Once this is done you can define your `board.I2C` object and define your sensor object |
| 162 | +
|
| 163 | + .. code-block:: python |
| 164 | +
|
| 165 | + i2c = board.I2C() # uses board.SCL and board.SDA |
| 166 | + sht = adafruit_sht31d.SHT31D(i2c) |
| 167 | +
|
| 168 | + Now you have access to the temperature and humidity the |
| 169 | + the :attr:`temperature` and :attr:`relative_humidity` attributes |
| 170 | +
|
| 171 | +
|
| 172 | + .. code-block:: python |
| 173 | +
|
| 174 | + temperature = sht.temperature |
| 175 | + humidity = sht.relative_humidity |
| 176 | +
|
150 | 177 | """ |
151 | 178 |
|
152 | 179 | def __init__(self, i2c_bus, address=_SHT31_DEFAULT_ADDRESS): |
@@ -326,7 +353,7 @@ def frequency(self, value): |
326 | 353 | @property |
327 | 354 | def temperature(self): |
328 | 355 | """ |
329 | | - The measured temperature in degrees celsius. |
| 356 | + The measured temperature in degrees Celsius. |
330 | 357 | 'Single' mode reads and returns the current temperature as a float. |
331 | 358 | 'Periodic' mode returns the most recent readings available from the sensor's cache |
332 | 359 | in a FILO list of eight floats. This list is backfilled with with the |
|
0 commit comments