File tree Expand file tree Collapse file tree 4 files changed +10
-11
lines changed Expand file tree Collapse file tree 4 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -63,11 +63,10 @@ Usage Example
6363
6464 import time
6565 import board
66- import busio
6766 import adafruit_ahtx0
6867
69- # Create library object using our Bus I2C port
70- i2c = busio .I2C(board. SCL , board. SDA )
68+ # Create sensor object, communicating over the board's default I2C bus
69+ i2c = board .I2C()
7170 sensor = adafruit_ahtx0.AHTx0(i2c)
7271
7372 while True :
Original file line number Diff line number Diff line change @@ -46,24 +46,23 @@ class AHTx0:
4646 Interface library for AHT10/AHT20 temperature+humidity sensors
4747
4848 :param ~busio.I2C i2c_bus: The I2C bus the AHT10/AHT20 is connected to.
49- :param address: The I2C device address for the sensor . Default is :const:`0x38`
49+ :param int address: The I2C device address. Default is :const:`0x38`
5050
5151 **Quickstart: Importing and using the AHT10/AHT20 temperature sensor**
5252
53- Here is one way of importing the `AHTx0` class so you can use it with the name ``aht`` .
53+ Here is an example of using the :class: `AHTx0` class.
5454 First you will need to import the libraries to use the sensor
5555
5656 .. code-block:: python
5757
58- import busio
5958 import board
6059 import adafruit_ahtx0
6160
62- Once this is done you can define your `busio .I2C` object and define your sensor object
61+ Once this is done you can define your `board .I2C` object and define your sensor object
6362
6463 .. code-block:: python
6564
66- i2c = busio .I2C(board.SCL, board.SDA)
65+ i2c = board .I2C() # uses board.SCL and board.SDA
6766 aht = adafruit_ahtx0.AHTx0(i2c)
6867
6968 Now you have access to the temperature and humidity using
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 AHT20 - Temperature & Humidity Sensor Breakout Board Learning Guide <https://learn.adafruit.com/adafruit-aht20 >
27+
2628.. toctree ::
2729 :caption: Related Products
2830
Original file line number Diff line number Diff line change 77
88import time
99import board
10- import busio
1110import adafruit_ahtx0
1211
13- # Create the sensor object using I2C
14- i2c = busio .I2C (board . SCL , board . SDA )
12+ # Create sensor object, communicating over the board's default I2C bus
13+ i2c = board .I2C ()
1514sensor = adafruit_ahtx0 .AHTx0 (i2c )
1615
1716while True :
You can’t perform that action at this time.
0 commit comments