File tree 3 files changed +6
-9
lines changed
3 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -59,10 +59,9 @@ Usage Example
59
59
60
60
import time
61
61
import board
62
- import busio
63
62
import adafruit_adt7410
64
63
65
- i2c_bus = busio .I2C(board. SCL , board. SDA )
64
+ i2c_bus = board .I2C()
66
65
adt = adafruit_adt7410.ADT7410(i2c_bus, address = 0x 48 )
67
66
adt.high_resolution = True
68
67
Original file line number Diff line number Diff line change @@ -52,24 +52,23 @@ class ADT7410:
52
52
"""Interface to the Analog Devices ADT7410 temperature sensor.
53
53
54
54
:param ~busio.I2C i2c_bus: The I2C bus the ADT7410 is connected to.
55
- :param int address: The I2C device address for the sensor . Default is :const:`0x48`
55
+ :param int address: The I2C device address. Default is :const:`0x48`
56
56
57
57
**Quickstart: Importing and using the ADT7410 temperature sensor**
58
58
59
- Here is one way of importing the `ADT7410` class so you can use it with the name ``adt`` .
59
+ Here is an example of using the :class: `ADT7410` class.
60
60
First you will need to import the libraries to use the sensor
61
61
62
62
.. code-block:: python
63
63
64
- import busio
65
64
import board
66
65
import adafruit_adt7410
67
66
68
- Once this is done you can define your `busio .I2C` object and define your sensor object
67
+ Once this is done you can define your `board .I2C` object and define your sensor object
69
68
70
69
.. code-block:: python
71
70
72
- i2c = busio .I2C(board.SCL, board.SDA)
71
+ i2c = board .I2C() # uses board.SCL and board.SDA
73
72
adt = adafruit_adt7410.ADT7410(i2c_bus, address=0x48)
74
73
75
74
Now you have access to the temperature using :attr:`temperature`.
Original file line number Diff line number Diff line change 3
3
4
4
import time
5
5
import board
6
- import busio
7
6
import adafruit_adt7410
8
7
9
- i2c_bus = busio .I2C (board . SCL , board . SDA )
8
+ i2c_bus = board .I2C ()
10
9
adt = adafruit_adt7410 .ADT7410 (i2c_bus , address = 0x48 )
11
10
adt .high_resolution = True
12
11
You can’t perform that action at this time.
0 commit comments