We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0011212 + 5094b67 commit 7b19752Copy full SHA for 7b19752
examples/mcp9808_simpletest.py
@@ -3,10 +3,17 @@
3
import busio
4
import adafruit_mcp9808
5
6
-# This example shows how to get the temperature from a MCP9808 board
7
i2c_bus = busio.I2C(board.SCL, board.SDA)
+
8
+# To initialise using the default address:
9
mcp = adafruit_mcp9808.MCP9808(i2c_bus)
10
11
+# To initialise using a specified address:
12
+# Necessary when, for example, connecting A0 to VDD to make address=0x19
13
+# mcp = adafruit_mcp9808.MCP9808(i2c_bus, address=0x19)
14
15
16
17
while True:
18
tempC = mcp.temperature
19
tempF = tempC * 9 / 5 + 32
0 commit comments