wollewald / VL6180X_WE

Library for VL6180X promity and ambient light sensor
https://wolles-elektronikkiste.de/vl6180x-tof-proximity-and-ambient-light-sensor?lang=en
3 stars 0 forks source link

ChangeAddress method not working #2

Closed SuperNONO06 closed 1 year ago

SuperNONO06 commented 1 year ago

Hello,

Thank you for providing this library to the Arduino comunity, i enjoy it;

I was playing with it in a multiple sensor system and could not "change the address" of the device without error. I have manage to solve the issue by adding the line :

_i2caddress = new_address;

just after : uint8_t VL6180x::changeAddress(uint8_t old_address, uint8_t new_address){

//NOTICE: IT APPEARS THAT CHANGING THE ADDRESS IS NOT STORED IN NON-VOLATILE MEMORY // POWER CYCLING THE DEVICE REVERTS ADDRESS BACK TO 0X29

if( old_address == new_address) return old_address; if( new_address > 127) return old_address;

VL6180x_setRegister(VL6180X_I2C_SLAVE_DEVICE_ADDRESS, new_address);

in the file VL6180X_WE.cpp

Best regards.

Bruno

wollewald commented 1 year ago

Hi @SuperNONO06,

thanks for raising the issue AND providing the solution!!!

I have just added the line and published a new release.

Best wishes,

Wolfgang

SuperNONO06 commented 1 year ago

Thanks a Lot wollewald !

Best regards