From a98b2f1b5d39c0001c347d2729987b77a6a785cd Mon Sep 17 00:00:00 2001 From: caternuson Date: Fri, 12 Feb 2021 16:25:37 -0800 Subject: [PATCH] update address change --- adafruit_vl53l0x.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/adafruit_vl53l0x.py b/adafruit_vl53l0x.py index ce04301..32f4c1d 100644 --- a/adafruit_vl53l0x.py +++ b/adafruit_vl53l0x.py @@ -139,6 +139,7 @@ class VL53L0X: def __init__(self, i2c, address=41, io_timeout_s=0): # pylint: disable=too-many-statements + self._i2c = i2c self._device = i2c_device.I2CDevice(i2c, address) self.io_timeout_s = io_timeout_s # Check identification registers for expected values. @@ -559,4 +560,4 @@ def set_address(self, new_address): "SHDN" pin is pulled HIGH again the default I2C address is ``0x29``. """ self._write_u8(_I2C_SLAVE_DEVICE_ADDRESS, new_address & 0x7F) - self._device.device_address = new_address + self._device = i2c_device.I2CDevice(self._i2c, new_address)