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
6262.. code-block :: python
6363
6464 import time
65- import busio
6665 import board
6766 import adafruit_sht4x
6867
69- i2c = busio .I2C(board.SCL , board.SDA )
68+ i2c = board .I2C() # uses board.SCL and board.SDA
7069 sht = adafruit_sht4x.SHT4x(i2c)
7170 print (" Found SHT4x with serial number" , hex (sht.serial_number))
7271
Original file line number Diff line number Diff line change @@ -86,26 +86,25 @@ class SHT4x:
8686 """
8787 A driver for the SHT4x temperature and humidity sensor.
8888
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`
9191
9292
9393 **Quickstart: Importing and using the SHT4x temperature and humidity sensor**
9494
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 `.
9696 First you will need to import the libraries to use the sensor
9797
9898 .. code-block:: python
9999
100- import busio
101100 import board
102101 import adafruit_sht4x
103102
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
105104
106105 .. code-block:: python
107106
108- i2c = busio .I2C(board.SCL, board.SDA)
107+ i2c = board .I2C() # uses board.SCL and board.SDA
109108 sht = adafruit_sht4x.SHT4x(i2c)
110109
111110 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
2323.. toctree ::
2424 :caption: Tutorials
2525
26+ Adafruit Sensirion SHT40 Temperature & Humidity Sensor <https://learn.adafruit.com/adafruit-sht40-temperature-humidity-sensor >
27+
2628.. toctree ::
2729 :caption: Related Products
2830
Original file line number Diff line number Diff line change 33# SPDX-License-Identifier: MIT
44
55import time
6- import busio
76import board
87import adafruit_sht4x
98
10- i2c = busio .I2C (board . SCL , board . SDA )
9+ i2c = board .I2C ()
1110sht = adafruit_sht4x .SHT4x (i2c )
1211print ("Found SHT4x with serial number" , hex (sht .serial_number ))
1312
You can’t perform that action at this time.
0 commit comments