Skip to content

Commit 7b19752

Browse files
authored
Merge pull request #20 from signalmeister/signalmeister-patch-1
Update mcp9808_simpletest.py
2 parents 0011212 + 5094b67 commit 7b19752

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

examples/mcp9808_simpletest.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,17 @@
33
import busio
44
import adafruit_mcp9808
55

6-
# This example shows how to get the temperature from a MCP9808 board
76
i2c_bus = busio.I2C(board.SCL, board.SDA)
7+
8+
# To initialise using the default address:
89
mcp = adafruit_mcp9808.MCP9808(i2c_bus)
910

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+
1017
while True:
1118
tempC = mcp.temperature
1219
tempF = tempC * 9 / 5 + 32

0 commit comments

Comments
 (0)