Skip to content

Commit 870a559

Browse files
authored
Merge pull request #13 from adafruit/deshipu-patch-1
fix#12: use "address" not "device_address" keyword
2 parents 391b632 + b946fdf commit 870a559

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

adafruit_mcp9808.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ class MCP9808:
6767
# temperature
6868
# temperature_resolution
6969

70-
def __init__(self, i2c_bus, device_address=0b0011000):
71-
self.i2c_device = I2CDevice(i2c_bus, device_address)
70+
def __init__(self, i2c_bus, address=0x18):
71+
self.i2c_device = I2CDevice(i2c_bus, address)
7272

7373
# Verify the manufacturer and device ids to ensure we are talking to
7474
# what we expect.
@@ -87,7 +87,7 @@ def __init__(self, i2c_bus, device_address=0b0011000):
8787
i2c.readinto(self.buf, start=1)
8888

8989
if not ok or self.buf[1] != 0x04:
90-
raise ValueError("Unable to find MCP9808 at i2c address " + str(hex(device_address)))
90+
raise ValueError("Unable to find MCP9808 at i2c address " + str(hex(address)))
9191

9292
@property
9393
def temperature(self):

0 commit comments

Comments
 (0)