Skip to content

Commit cc29a31

Browse files
Merge pull request #16 from jposada202020/adding_board.I2C_reference
Adding board.I2C reference
2 parents a5eae66 + fe02070 commit cc29a31

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

README.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,9 @@ Usage Example
5959
6060
import time
6161
import board
62-
import busio
6362
import adafruit_adt7410
6463
65-
i2c_bus = busio.I2C(board.SCL, board.SDA)
64+
i2c_bus = board.I2C()
6665
adt = adafruit_adt7410.ADT7410(i2c_bus, address=0x48)
6766
adt.high_resolution = True
6867

adafruit_adt7410.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,24 +52,23 @@ class ADT7410:
5252
"""Interface to the Analog Devices ADT7410 temperature sensor.
5353
5454
: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`
5656
5757
**Quickstart: Importing and using the ADT7410 temperature sensor**
5858
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.
6060
First you will need to import the libraries to use the sensor
6161
6262
.. code-block:: python
6363
64-
import busio
6564
import board
6665
import adafruit_adt7410
6766
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
6968
7069
.. code-block:: python
7170
72-
i2c = busio.I2C(board.SCL, board.SDA)
71+
i2c = board.I2C() # uses board.SCL and board.SDA
7372
adt = adafruit_adt7410.ADT7410(i2c_bus, address=0x48)
7473
7574
Now you have access to the temperature using :attr:`temperature`.

examples/adt7410_simpletest.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33

44
import time
55
import board
6-
import busio
76
import adafruit_adt7410
87

9-
i2c_bus = busio.I2C(board.SCL, board.SDA)
8+
i2c_bus = board.I2C()
109
adt = adafruit_adt7410.ADT7410(i2c_bus, address=0x48)
1110
adt.high_resolution = True
1211

0 commit comments

Comments
 (0)