16
16
17
17
**Hardware:**
18
18
19
+ * `Adafruit's ADT7410 analog temperature Sensor Breakout:
20
+ <https://www.adafruit.com/product/4089>`_ (Product ID: 4089)
21
+
19
22
**Software and Dependencies:**
20
23
21
24
* Adafruit CircuitPython firmware for the supported boards:
46
49
47
50
48
51
class ADT7410 :
49
- """Interface to the Analog Devices ADT7410 temperature sensor."""
52
+ """Interface to the Analog Devices ADT7410 temperature sensor.
53
+
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`
56
+
57
+ **Quickstart: Importing and using the ADT7410 temperature sensor**
58
+
59
+ Here is one way of importing the `ADT7410` class so you can use it with the name ``adt``.
60
+ First you will need to import the libraries to use the sensor
61
+
62
+ .. code-block:: python
63
+
64
+ import busio
65
+ import board
66
+ import adafruit_adt7410
67
+
68
+ Once this is done you can define your `busio.I2C` object and define your sensor object
69
+
70
+ .. code-block:: python
71
+
72
+ i2c = busio.I2C(board.SCL, board.SDA)
73
+ adt = adafruit_adt7410.ADT7410(i2c_bus, address=0x48)
74
+
75
+ Now you have access to the temperature using :attr:`temperature`.
76
+
77
+ .. code-block:: python
78
+
79
+ temperature = adt.temperature
80
+
81
+ """
50
82
51
83
# many modes can be set with register objects for simplicity
52
84
ready = ROBit (_ADT7410_STATUS , 7 )
@@ -69,7 +101,7 @@ def __init__(self, i2c_bus, address=0x48):
69
101
70
102
@property
71
103
def temperature (self ):
72
- """The temperature in celsius """
104
+ """The temperature in Celsius """
73
105
temp = self ._read_register (_ADT7410_TEMPMSB , 2 )
74
106
return struct .unpack (">h" , temp )[0 ] / 128
75
107
0 commit comments