diff --git a/adafruit_adt7410.py b/adafruit_adt7410.py index b6a33b1..c2160f5 100644 --- a/adafruit_adt7410.py +++ b/adafruit_adt7410.py @@ -16,6 +16,9 @@ **Hardware:** +* `Adafruit's ADT7410 analog temperature Sensor Breakout: + `_ (Product ID: 4089) + **Software and Dependencies:** * Adafruit CircuitPython firmware for the supported boards: @@ -46,7 +49,36 @@ class ADT7410: - """Interface to the Analog Devices ADT7410 temperature sensor.""" + """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` + + **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``. + 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 + + .. code-block:: python + + i2c = busio.I2C(board.SCL, board.SDA) + adt = adafruit_adt7410.ADT7410(i2c_bus, address=0x48) + + Now you have access to the temperature using :attr:`temperature`. + + .. code-block:: python + + temperature = adt.temperature + + """ # many modes can be set with register objects for simplicity ready = ROBit(_ADT7410_STATUS, 7) @@ -69,7 +101,7 @@ def __init__(self, i2c_bus, address=0x48): @property def temperature(self): - """The temperature in celsius""" + """The temperature in Celsius""" temp = self._read_register(_ADT7410_TEMPMSB, 2) return struct.unpack(">h", temp)[0] / 128 diff --git a/docs/index.rst b/docs/index.rst index e3b2e78..b7baacd 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -23,9 +23,13 @@ Table of Contents .. toctree:: :caption: Tutorials + ADT7410 High Accuracy I2C Temperature Sensor Learning Guide + .. toctree:: :caption: Related Products + ADT7410 High Accuracy I2C Temperature Sensor Breakout Board + .. toctree:: :caption: Other Links