File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 34
34
# imports__version__ = "0.0.0-auto.0"
35
35
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_VL53L1X.git"
36
36
37
+ _VL53L1X_I2C_SLAVE_DEVICE_ADDRESS = const (0x0001 )
37
38
_VL53L1X_VHV_CONFIG__TIMEOUT_MACROP_LOOP_BOUND = const (0x0008 )
38
39
_GPIO_HV_MUX__CTRL = const (0x0030 )
39
40
_GPIO__TIO_HV_STATUS = const (0x0031 )
@@ -309,6 +310,7 @@ def set_address(self, new_address):
309
310
multiple VL53L0X sensors on the same I2C bus (SDA & SCL pins). See also the
310
311
`example <examples.html#multiple-vl53l1x-on-same-i2c-bus>`_ for proper usage.
311
312
"""
312
- new_addres_as_byte_string = new_address .to_bytes (1 , "little" )
313
- self ._write_register (0x01 , new_addres_as_byte_string )
313
+ self ._write_register (
314
+ _VL53L1X_I2C_SLAVE_DEVICE_ADDRESS , struct .pack (">B" , new_address )
315
+ )
314
316
self .i2c_device = i2c_device .I2CDevice (self ._i2c , new_address )
You can’t perform that action at this time.
0 commit comments