Skip to content

Changing board.I2C reference,adding learning guide #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,9 @@ Usage Example

from time import sleep
import board
import busio
from adafruit_ms8607 import MS8607

i2c = busio.I2C(board.SCL, board.SDA)
i2c = board.I2C()
sensor = MS8607(i2c)

while True:
Expand Down
8 changes: 3 additions & 5 deletions adafruit_ms8607.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,23 +122,21 @@ class MS8607:

:param ~busio.I2C i2c_bus: The I2C bus the MS8607 is connected to.


**Quickstart: Importing and using the MS8607 temperature sensor**

Here is one way of importing the `MS8607` class so you can use it with the name ``ms``.
Here is an example of using the :class:`MS8607` class.
First you will need to import the libraries to use the sensor

.. code-block:: python

import busio
import board
import adafruit_ms8607

Once this is done you can define your `busio.I2C` object and define your sensor object
Once this is done you can define your `board.I2C` object and define your sensor object

.. code-block:: python

i2c = busio.I2C(board.SCL, board.SDA)
i2c = board.I2C() # uses board.SCL and board.SDA
ms = adafruit_ms8607.MS8607(i2c)

Now you have access to the pressure, temperature and humidity using
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Table of Contents
.. toctree::
:caption: Tutorials

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

.. toctree::
:caption: Related Products
Expand Down
3 changes: 1 addition & 2 deletions examples/ms8607_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
# SPDX-License-Identifier: MIT
from time import sleep
import board
import busio
from adafruit_ms8607 import MS8607

i2c = busio.I2C(board.SCL, board.SDA)
i2c = board.I2C()
sensor = MS8607(i2c)

while True:
Expand Down