Skip to content

Commit b806664

Browse files
authored
Merge pull request #26 from caternuson/iss25
Update I2C Address Change
2 parents 36f48d0 + a98b2f1 commit b806664

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

adafruit_vl53l0x.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ class VL53L0X:
139139

140140
def __init__(self, i2c, address=41, io_timeout_s=0):
141141
# pylint: disable=too-many-statements
142+
self._i2c = i2c
142143
self._device = i2c_device.I2CDevice(i2c, address)
143144
self.io_timeout_s = io_timeout_s
144145
# Check identification registers for expected values.
@@ -559,4 +560,4 @@ def set_address(self, new_address):
559560
"SHDN" pin is pulled HIGH again the default I2C address is ``0x29``.
560561
"""
561562
self._write_u8(_I2C_SLAVE_DEVICE_ADDRESS, new_address & 0x7F)
562-
self._device.device_address = new_address
563+
self._device = i2c_device.I2CDevice(self._i2c, new_address)

0 commit comments

Comments
 (0)