Skip to content

Commit

Permalink
Merge pull request #20 from dhalbert/no-probe
Browse files Browse the repository at this point in the history
Do not let I2CDevice probe for the device
  • Loading branch information
tannewt committed May 11, 2022
2 parents 1996bc9 + 0517db7 commit 5cfc8b0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion adafruit_mcp9600.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,10 @@ def __init__(
tcfilter: int = 0,
) -> None:
self.buf = bytearray(3)
self.i2c_device = I2CDevice(i2c, address)
# Do not probe for the device with a zero-length write.
# The MCP960x does not like zero-length writes and will usually NAK,
# unless the write is rapidly repeated.
self.i2c_device = I2CDevice(i2c, address, probe=False)
self.type = tctype
# is this a valid thermocouple type?
if tctype not in MCP9600.types:
Expand Down

0 comments on commit 5cfc8b0

Please sign in to comment.