17
17
18
18
**Hardware:**
19
19
20
- * Adafruit MCP9600 I2C Thermocouple Amplifier:
21
- https://www.adafruit.com/product/4101
20
+ * ` Adafruit MCP9600 I2C Thermocouple Amplifier:
21
+ < https://www.adafruit.com/product/4101>`_ (Product ID: 4101)
22
22
23
23
**Software and Dependencies:**
24
24
48
48
49
49
50
50
class MCP9600 :
51
- """Interface to the MCP9600 thermocouple amplifier breakout"""
51
+ """
52
+ Interface to the MCP9600 thermocouple amplifier breakout
53
+
54
+ :param ~busio.I2C i2c: The I2C bus the MCP9600 is connected to.
55
+ :param int address: The I2C address of the device. Defaults to :const:`0x67`
56
+ :param str tctype: Thermocouple type. Defaults to :const:`"K"`
57
+ :param int tcfilter: Value for the temperature filter. Can limit spikes in
58
+ temperature readings. Defaults to :const:`0`
59
+
60
+
61
+ **Quickstart: Importing and using the MCP9600 temperature sensor**
62
+
63
+ Here is one way of importing the `MCP9600` class so you can use it with the name ``mcp``.
64
+ First you will need to import the libraries to use the sensor
65
+
66
+ .. code-block:: python
67
+
68
+ import busio
69
+ import board
70
+ import adafruit_mcp9600
71
+
72
+ Once this is done you can define your `busio.I2C` object and define your sensor object
73
+
74
+ .. code-block:: python
75
+
76
+ i2c = busio.I2C(board.SCL, board.SDA, frequency=100000)
77
+ mcp = adafruit_mcp9600.MCP9600(i2c)
78
+
79
+
80
+ Now you have access to the change in temperature using the
81
+ :attr:`delta_temperature` attribute, the thermocouple or hot junction
82
+ temperature in degrees Celsius using the :attr:`temperature`
83
+ attribute and the ambient or cold-junction temperature in degrees Celsius
84
+ using the :attr:`ambient_temperature` attribute
85
+
86
+ .. code-block:: python
87
+
88
+ delta_temperature = mcp.delta_temperature
89
+ temperature = mcp.temperature
90
+ ambient_temperature = mcp.ambient_temperature
91
+
92
+
93
+ """
52
94
53
95
# Shutdown mode options
54
96
NORMAL = 0b00
@@ -191,7 +233,7 @@ def alert_config(
191
233
alert_state
192
234
):
193
235
"""Configure a specified alert pin. Alert is enabled by default when alert is configured.
194
- To disable an alert pin, use `` alert_disable` `.
236
+ To disable an alert pin, use :meth:` alert_disable`.
195
237
196
238
:param int alert_number: The alert pin number. Must be 1-4.
197
239
:param alert_temp_source: The temperature source to monitor for the alert. Options are:
@@ -213,8 +255,8 @@ def alert_config(
213
255
comparator mode, the pin will follow the alert, so if the temperature
214
256
drops, for example, the alert pin will go back low. In interrupt mode,
215
257
by comparison, once the alert goes off, you must manually clear it. If
216
- setting mode to ``INTERRUPT``, use `` alert_interrupt_clear`` to clear the
217
- interrupt flag.
258
+ setting mode to ``INTERRUPT``, use :meth:` alert_interrupt_clear`
259
+ to clear the interrupt flag.
218
260
:param alert_state: Alert pin output state. Options are ``ACTIVE_HIGH`` or ``ACTIVE_LOW``.
219
261
220
262
@@ -255,8 +297,8 @@ def alert_config(
255
297
setattr (self , "_alert_%d_enable" % alert_number , True )
256
298
257
299
def alert_disable (self , alert_number ):
258
- """Configuring an alert using `` alert_config()` ` enables the specified alert by default.
259
- Use `` alert_disable` ` to disable an alert pin.
300
+ """Configuring an alert using :meth:` alert_config` enables the specified alert by default.
301
+ Use :meth:` alert_disable` to disable an alert pin.
260
302
261
303
:param int alert_number: The alert pin number. Must be 1-4.
262
304
0 commit comments