Skip to content

Commit 33f2474

Browse files
authored
Merge pull request #7 from jposada202020/improving_docs
Improving docs and correcting related product description
2 parents be87a42 + d84f269 commit 33f2474

File tree

2 files changed

+34
-5
lines changed

2 files changed

+34
-5
lines changed

adafruit_ms8607.py

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@
1616
1717
**Hardware:**
1818
19-
* `Adafruit MS8607 Breakout <https:#www.adafruit.com/products/4716>`_
19+
* `Adafruit's MS8607 Pressure Humidity Temperature Breakout
20+
<https://www.adafruit.com/product/4716>`_
2021
2122
**Software and Dependencies:**
2223
2324
* Adafruit CircuitPython firmware for the supported boards:
24-
https:#github.com/adafruit/circuitpython/releases
25+
https://github.com/adafruit/circuitpython/releases
2526
2627
* Adafruit's Bus Device library: https:#github.com/adafruit/Adafruit_CircuitPython_BusDevice
2728
* Adafruit's Register library: https:#github.com/adafruit/Adafruit_CircuitPython_Register
@@ -116,11 +117,39 @@ class PressureResolution(CV):
116117

117118

118119
class MS8607:
119-
"""Library for the MS8607 Pressure Temperature and Humidity Sensor
120-
120+
"""
121+
Library for the MS8607 Pressure, Temperature and Humidity Sensor
121122
122123
:param ~busio.I2C i2c_bus: The I2C bus the MS8607 is connected to.
123124
125+
126+
**Quickstart: Importing and using the MS8607 temperature sensor**
127+
128+
Here is one way of importing the `MS8607` class so you can use it with the name ``ms``.
129+
First you will need to import the libraries to use the sensor
130+
131+
.. code-block:: python
132+
133+
import busio
134+
import board
135+
import adafruit_ms8607
136+
137+
Once this is done you can define your `busio.I2C` object and define your sensor object
138+
139+
.. code-block:: python
140+
141+
i2c = busio.I2C(board.SCL, board.SDA)
142+
ms = adafruit_ms8607.MS8607(i2c)
143+
144+
Now you have access to the pressure, temperature and humidity using
145+
the :attr:`pressure`, :attr:`temperature` and :attr:`relative_humidity` attributes
146+
147+
.. code-block:: python
148+
149+
temperature = ms.temperature
150+
relative_humidity = ms.relative_humidity
151+
pressure = ms.pressure
152+
124153
"""
125154

126155
def __init__(self, i2c_bus):

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Table of Contents
2727
.. toctree::
2828
:caption: Related Products
2929

30-
* `Adafruit MS8607 Breakout <https://www.adafruit.com/products/4716>`_
30+
Adafruit MS8607 Breakout <https://www.adafruit.com/products/4716>
3131

3232
.. toctree::
3333
:caption: Other Links

0 commit comments

Comments
 (0)