diff --git a/README.rst b/README.rst index 7c73902..035ecdc 100644 --- a/README.rst +++ b/README.rst @@ -59,10 +59,9 @@ Usage Example import time import board - import busio import adafruit_adt7410 - i2c_bus = busio.I2C(board.SCL, board.SDA) + i2c_bus = board.I2C() adt = adafruit_adt7410.ADT7410(i2c_bus, address=0x48) adt.high_resolution = True diff --git a/adafruit_adt7410.py b/adafruit_adt7410.py index c2160f5..f3a644f 100644 --- a/adafruit_adt7410.py +++ b/adafruit_adt7410.py @@ -52,24 +52,23 @@ class ADT7410: """Interface to the Analog Devices ADT7410 temperature sensor. :param ~busio.I2C i2c_bus: The I2C bus the ADT7410 is connected to. - :param int address: The I2C device address for the sensor. Default is :const:`0x48` + :param int address: The I2C device address. Default is :const:`0x48` **Quickstart: Importing and using the ADT7410 temperature sensor** - Here is one way of importing the `ADT7410` class so you can use it with the name ``adt``. + Here is an example of using the :class:`ADT7410` class. First you will need to import the libraries to use the sensor .. code-block:: python - import busio import board import adafruit_adt7410 - Once this is done you can define your `busio.I2C` object and define your sensor object + Once this is done you can define your `board.I2C` object and define your sensor object .. code-block:: python - i2c = busio.I2C(board.SCL, board.SDA) + i2c = board.I2C() # uses board.SCL and board.SDA adt = adafruit_adt7410.ADT7410(i2c_bus, address=0x48) Now you have access to the temperature using :attr:`temperature`. diff --git a/examples/adt7410_simpletest.py b/examples/adt7410_simpletest.py index 702b7e5..29c87e7 100644 --- a/examples/adt7410_simpletest.py +++ b/examples/adt7410_simpletest.py @@ -3,10 +3,9 @@ import time import board -import busio import adafruit_adt7410 -i2c_bus = busio.I2C(board.SCL, board.SDA) +i2c_bus = board.I2C() adt = adafruit_adt7410.ADT7410(i2c_bus, address=0x48) adt.high_resolution = True