diff --git a/Api/core/src/vl53l0x_api.c b/Api/core/src/vl53l0x_api.c index 8a80095..cacbd6f 100644 --- a/Api/core/src/vl53l0x_api.c +++ b/Api/core/src/vl53l0x_api.c @@ -358,7 +358,7 @@ VL53L0X_Error VL53L0X_SetDeviceAddress(VL53L0X_DEV Dev, uint8_t DeviceAddress) LOG_FUNCTION_START(""); Status = VL53L0X_WrByte(Dev, VL53L0X_REG_I2C_SLAVE_DEVICE_ADDRESS, - DeviceAddress / 2); + DeviceAddress); LOG_FUNCTION_END(Status); return Status; diff --git a/Api/core/src/vl53l0x_api.c.bak b/Api/core/src/vl53l0x_api.c.bak index 841d940..37eb447 100644 --- a/Api/core/src/vl53l0x_api.c.bak +++ b/Api/core/src/vl53l0x_api.c.bak @@ -358,7 +358,7 @@ VL53L0X_Error VL53L0X_SetDeviceAddress(VL53L0X_DEV Dev, uint8_t DeviceAddress) LOG_FUNCTION_START(""); Status = VL53L0X_WrByte(Dev, VL53L0X_REG_I2C_SLAVE_DEVICE_ADDRESS, - DeviceAddress / 2); + DeviceAddress); LOG_FUNCTION_END(Status); return Status; diff --git a/python_lib/vl53l0x_python.c b/python_lib/vl53l0x_python.c index 20495aa..834b5e7 100644 --- a/python_lib/vl53l0x_python.c +++ b/python_lib/vl53l0x_python.c @@ -194,10 +194,7 @@ void startRanging(int object_number, int mode, uint8_t i2c_address, uint8_t TCA9 // Address requested not default so set the address. // This assumes that the shutdown pin has been controlled // externally to this function. - // TODO: Why does this function divide the address by 2? To get - // the address we want we have to mutiply by 2 in the call so - // it gets set right - Status = VL53L0X_SetDeviceAddress(pMyDevice[object_number], (i2c_address * 2)); + Status = VL53L0X_SetDeviceAddress(pMyDevice[object_number], (i2c_address)); pMyDevice[object_number]->I2cDevAddr = i2c_address; }