File tree Expand file tree Collapse file tree 4 files changed +9
-10
lines changed Expand file tree Collapse file tree 4 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -62,11 +62,10 @@ Usage Example
62
62
.. code-block :: python
63
63
64
64
import time
65
- import busio
66
65
import board
67
66
import adafruit_sht4x
68
67
69
- i2c = busio .I2C(board.SCL , board.SDA )
68
+ i2c = board .I2C() # uses board.SCL and board.SDA
70
69
sht = adafruit_sht4x.SHT4x(i2c)
71
70
print (" Found SHT4x with serial number" , hex (sht.serial_number))
72
71
Original file line number Diff line number Diff line change @@ -86,26 +86,25 @@ class SHT4x:
86
86
"""
87
87
A driver for the SHT4x temperature and humidity sensor.
88
88
89
- :param ~busio.I2C i2c_bus: The `busio. I2C` object to use .
90
- :param int address: The I2C device address for the sensor . Default is :const:`0x44`
89
+ :param ~busio.I2C i2c_bus: The I2C bus the SHT4x is connected to .
90
+ :param int address: The I2C device address. Default is :const:`0x44`
91
91
92
92
93
93
**Quickstart: Importing and using the SHT4x temperature and humidity sensor**
94
94
95
- Here is one way of importing the `SHT4x` class so you can use it with the name ``sht` `.
95
+ Here is an example of using the : class:`SHT4x `.
96
96
First you will need to import the libraries to use the sensor
97
97
98
98
.. code-block:: python
99
99
100
- import busio
101
100
import board
102
101
import adafruit_sht4x
103
102
104
- Once this is done you can define your `busio .I2C` object and define your sensor object
103
+ Once this is done you can define your `board .I2C` object and define your sensor object
105
104
106
105
.. code-block:: python
107
106
108
- i2c = busio .I2C(board.SCL, board.SDA)
107
+ i2c = board .I2C() # uses board.SCL and board.SDA
109
108
sht = adafruit_sht4x.SHT4x(i2c)
110
109
111
110
You can now make some initial settings on the sensor
Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ Table of Contents
23
23
.. toctree ::
24
24
:caption: Tutorials
25
25
26
+ Adafruit Sensirion SHT40 Temperature & Humidity Sensor <https://learn.adafruit.com/adafruit-sht40-temperature-humidity-sensor >
27
+
26
28
.. toctree ::
27
29
:caption: Related Products
28
30
Original file line number Diff line number Diff line change 3
3
# SPDX-License-Identifier: MIT
4
4
5
5
import time
6
- import busio
7
6
import board
8
7
import adafruit_sht4x
9
8
10
- i2c = busio .I2C (board . SCL , board . SDA )
9
+ i2c = board .I2C ()
11
10
sht = adafruit_sht4x .SHT4x (i2c )
12
11
print ("Found SHT4x with serial number" , hex (sht .serial_number ))
13
12
You can’t perform that action at this time.
0 commit comments