File tree 4 files changed +10
-12
lines changed 4 files changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -63,11 +63,10 @@ Usage Example
63
63
.. code-block :: python3
64
64
65
65
import time
66
- import busio
67
66
import board
68
67
import adafruit_shtc3
69
68
70
- i2c = busio .I2C(board.SCL, board.SDA)
69
+ i2c = board .I2C() # uses board.SCL and board.SDA
71
70
sht = adafruit_shtc3.SHTC3(i2c)
72
71
73
72
while True:
Original file line number Diff line number Diff line change @@ -81,24 +81,23 @@ class SHTC3:
81
81
"""
82
82
A driver for the SHTC3 temperature and humidity sensor.
83
83
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 .
85
85
86
86
**Quickstart: Importing and using the SHTC3 temperature and humidity sensor**
87
87
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
90
90
91
91
.. code-block:: python
92
92
93
- import busio
94
93
import board
95
94
import adafruit_shtc3
96
95
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
98
97
99
98
.. code-block:: python
100
99
101
- i2c = busio .I2C(board.SCL, board.SDA)
100
+ i2c = board .I2C() # uses board.SCL and board.SDA
102
101
sht = adafruit_shtc3.SHTC3(i2c)
103
102
104
103
Now you have access to the temperature and humidity using the :attr:`measurements`.
@@ -146,7 +145,7 @@ def reset(self):
146
145
self ._write_command (_SHTC3_SOFTRESET )
147
146
148
147
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" :
150
149
raise run_err
151
150
time .sleep (0.001 )
152
151
Original file line number Diff line number Diff line change @@ -23,11 +23,12 @@ Table of Contents
23
23
.. toctree ::
24
24
:caption: Tutorials
25
25
26
-
26
+ Adafruit Sensirion SHTC3 Temperature & Humidity Sensor Learning Guide < https://learn.adafruit.com/adafruit-sensirion-shtc3-temperature-humidity-sensor >
27
27
28
28
.. toctree ::
29
29
:caption: Related Products
30
30
31
+ Adafruit Sensirion SHTC3 Temperature & Humidity Sensor <https://www.adafruit.com/product/4636 >
31
32
32
33
.. toctree ::
33
34
:caption: Other Links
Original file line number Diff line number Diff line change 2
2
#
3
3
# SPDX-License-Identifier: MIT
4
4
import time
5
- import busio
6
5
import board
7
6
import adafruit_shtc3
8
7
9
- i2c = busio .I2C (board . SCL , board . SDA )
8
+ i2c = board .I2C ()
10
9
sht = adafruit_shtc3 .SHTC3 (i2c )
11
10
12
11
while True :
You can’t perform that action at this time.
0 commit comments