Skip to content

Commit 5533dba

Browse files
Merge pull request #8 from jposada202020/adding_board.I2C_reference
Changing board.I2C reference,adding learning guide
2 parents 33f2474 + 2f2c440 commit 5533dba

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

README.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,9 @@ Usage Example
6262
6363
from time import sleep
6464
import board
65-
import busio
6665
from adafruit_ms8607 import MS8607
6766
68-
i2c = busio.I2C(board.SCL, board.SDA)
67+
i2c = board.I2C()
6968
sensor = MS8607(i2c)
7069
7170
while True:

adafruit_ms8607.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,23 +122,21 @@ class MS8607:
122122
123123
:param ~busio.I2C i2c_bus: The I2C bus the MS8607 is connected to.
124124
125-
126125
**Quickstart: Importing and using the MS8607 temperature sensor**
127126
128-
Here is one way of importing the `MS8607` class so you can use it with the name ``ms``.
127+
Here is an example of using the :class:`MS8607` class.
129128
First you will need to import the libraries to use the sensor
130129
131130
.. code-block:: python
132131
133-
import busio
134132
import board
135133
import adafruit_ms8607
136134
137-
Once this is done you can define your `busio.I2C` object and define your sensor object
135+
Once this is done you can define your `board.I2C` object and define your sensor object
138136
139137
.. code-block:: python
140138
141-
i2c = busio.I2C(board.SCL, board.SDA)
139+
i2c = board.I2C() # uses board.SCL and board.SDA
142140
ms = adafruit_ms8607.MS8607(i2c)
143141
144142
Now you have access to the pressure, temperature and humidity using

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Table of Contents
2323
.. toctree::
2424
:caption: Tutorials
2525

26+
Adafruit MS8607 Breakout Learning Guide <https://learn.adafruit.com/adafruit-te-ms8607-pht-sensor>
2627

2728
.. toctree::
2829
:caption: Related Products

examples/ms8607_simpletest.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
# SPDX-License-Identifier: MIT
33
from time import sleep
44
import board
5-
import busio
65
from adafruit_ms8607 import MS8607
76

8-
i2c = busio.I2C(board.SCL, board.SDA)
7+
i2c = board.I2C()
98
sensor = MS8607(i2c)
109

1110
while True:

0 commit comments

Comments
 (0)