Skip to content

fix#12: use "address" not "device_address" keyword #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions adafruit_mcp9808.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ class MCP9808:
# temperature
# temperature_resolution

def __init__(self, i2c_bus, device_address=0b0011000):
self.i2c_device = I2CDevice(i2c_bus, device_address)
def __init__(self, i2c_bus, address=0x18):
self.i2c_device = I2CDevice(i2c_bus, address)

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

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

@property
def temperature(self):
Expand Down