Skip to content

Commit ea6affa

Browse files
Tinyu-Zhaolbuque
authored andcommitted
libs/unit: Limit 8encoder I2C address range.
Signed-off-by: tinyu <[email protected]>
1 parent f151100 commit ea6affa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

m5stack/libs/unit/encoder8.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def set_i2c_address(self, addr: int = 0x41) -> None:
255255
addr:
256256
note: The new I2C address. Default is 0x41.
257257
"""
258-
if addr >= 1 and addr <= 127:
258+
if addr >= 0x08 and addr <= 0x77:
259259
if addr != self.i2c_addr:
260260
self.write_reg_data(self._ENCODER_I2C_ADDR_REG, [addr])
261261
self.i2c_addr = addr

0 commit comments

Comments
 (0)