diff options
Diffstat (limited to 'klippy/extras/mcp4451.py')
-rw-r--r-- | klippy/extras/mcp4451.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/klippy/extras/mcp4451.py b/klippy/extras/mcp4451.py index ddf322b1..d8b798e4 100644 --- a/klippy/extras/mcp4451.py +++ b/klippy/extras/mcp4451.py @@ -10,6 +10,9 @@ WiperRegisters = [0x00, 0x01, 0x06, 0x07] class mcp4451: def __init__(self, config): self.i2c = bus.MCU_I2C_from_config(config) + i2c_addr = self.i2c.get_i2c_address() + if i2c_addr < 44 or i2c_addr > 47: + raise config.error("mcp4451 address must be between 44 and 47") scale = config.getfloat('scale', 1., above=0.) # Configure registers self.set_register(0x04, 0xff) |