Skip to content

Commit 9ff74a2

Browse files
Merge pull request #10 from jposada202020/adding_board.I2C_definition
adding board.I2C, adding learning guide, product description
2 parents f12e925 + 0cd1595 commit 9ff74a2

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

README.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,10 @@ Usage Example
6363
.. code-block:: python3
6464
6565
import time
66-
import busio
6766
import board
6867
import adafruit_shtc3
6968
70-
i2c = busio.I2C(board.SCL, board.SDA)
69+
i2c = board.I2C() # uses board.SCL and board.SDA
7170
sht = adafruit_shtc3.SHTC3(i2c)
7271
7372
while True:

adafruit_shtc3.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,24 +81,23 @@ class SHTC3:
8181
"""
8282
A driver for the SHTC3 temperature and humidity sensor.
8383
84-
:param ~busio.I2C i2c_bus: The `busio.I2C` object to use. This is the only required parameter.
84+
:param ~busio.I2C i2c_bus: The I2C bus the SHTC3 is connected to.
8585
8686
**Quickstart: Importing and using the SHTC3 temperature and humidity sensor**
8787
88-
Here is one way of importing the `SHTC3` class so you can use it with the name ``sht``.
89-
First you will need to import the helper libraries to use the sensor
88+
Here is an example of using the :class:`SHTC3`.
89+
First you will need to import the libraries to use the sensor
9090
9191
.. code-block:: python
9292
93-
import busio
9493
import board
9594
import adafruit_shtc3
9695
97-
Once this is done, you can define your `busio.I2C` object and define your sensor
96+
Once this is done, you can define your `board.I2C` object and define your sensor
9897
9998
.. code-block:: python
10099
101-
i2c = busio.I2C(board.SCL, board.SDA)
100+
i2c = board.I2C() # uses board.SCL and board.SDA
102101
sht = adafruit_shtc3.SHTC3(i2c)
103102
104103
Now you have access to the temperature and humidity using the :attr:`measurements`.
@@ -146,7 +145,7 @@ def reset(self):
146145
self._write_command(_SHTC3_SOFTRESET)
147146

148147
except RuntimeError as run_err:
149-
if run_err.args and run_err.args[0] != "I2C slave address was NACK'd":
148+
if run_err.args and run_err.args[0] != "I2C device address was NACK'd":
150149
raise run_err
151150
time.sleep(0.001)
152151

docs/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@ Table of Contents
2323
.. toctree::
2424
:caption: Tutorials
2525

26-
26+
Adafruit Sensirion SHTC3 Temperature & Humidity Sensor Learning Guide <https://learn.adafruit.com/adafruit-sensirion-shtc3-temperature-humidity-sensor>
2727

2828
.. toctree::
2929
:caption: Related Products
3030

31+
Adafruit Sensirion SHTC3 Temperature & Humidity Sensor <https://www.adafruit.com/product/4636>
3132

3233
.. toctree::
3334
:caption: Other Links

examples/shtc3_simpletest.py

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

9-
i2c = busio.I2C(board.SCL, board.SDA)
8+
i2c = board.I2C()
109
sht = adafruit_shtc3.SHTC3(i2c)
1110

1211
while True:

0 commit comments

Comments
 (0)