adafruit/Adafruit_VL6180X

Offset registry missing

Opened this issue · 11 comments

Application note AN4545
VL6180X basic ranging application note

image

Other libraries that support this settings:

https://github.com/sparkfun/SparkFun_ToF_Range_Finder-VL6180_Arduino_Library
https://github.com/pololu/vl6180x-arduino

pull requests are welcome!

Application note AN4545
VL6180X basic ranging application note

image

Other libraries that support this settings:

https://github.com/sparkfun/SparkFun_ToF_Range_Finder-VL6180_Arduino_Library
https://github.com/pololu/vl6180x-arduino

Is it done? I would like to see that code.

Hi, @DanielMartensson
I just saw your message.
Yes, it's done, and it's work.
But I didnt send a Pull-Request.
I will do it soon.
I can guide you for quickly test if you are in rush.

Hi, @DanielMartensson
I just saw your message.
Yes, it's done, and it's work.
But I didnt send a Pull-Request.
I will do it soon.
I can guide you for quickly test if you are in rush.

Hi @ajsb85
Yes! Do a pull request. Or send me an example code. I have ported this Adafruit library to STM32 library here.
https://github.com/DanielMartensson/STM32-Libraries/tree/master/VL6180X

Also take a look here. You might like Unscented Kalman Filter in pure 100% C code.
https://github.com/DanielMartensson/CControl/blob/master/src/CControl/Documents/Examples/Filtering/ukf.txt

Here is the result. The red line is the filtered line.
image

@ajsb85

Hi!
Did you have the code? It's OK if it's Arduino C++ code. I can rewrite it to STM32 C code.

Can you point to where/how the linked Sparked fun library is supporting this? They #def the register:
https://github.com/sparkfun/SparkFun_ToF_Range_Finder-VL6180_Arduino_Library/blob/d71093ba3a4213ee7e61b91fd278735b01aba45c/src/SparkFun_VL6180X.h#L68
but not seeing it actually get used anywhere.

Also no obvious getter/setter func for this?

Notice that VL6180 and VL6180X is the same sensor. VL6180X has only the ALS sensor included. The ranging is the same for them both.

Where in the Sparkfun library is the SYSRANGE_PART_TO_PART_RANGE_OFFSET register being accessed? It's mentioned above that library supports this setting, but not seeing where.

In general, it looks like all that is needed is getter/setter for that register. But if there's more to it, would help to see example source code.

Where in the Sparkfun library is the SYSRANGE_PART_TO_PART_RANGE_OFFSET register being accessed? It's mentioned above that library supports this setting, but not seeing where.

In general, it looks like all that is needed is getter/setter for that register. But if there's more to it, would help to see example source code.

Good question!
Who wrote that library?

And it looks like the pololu library only updates the existing setting to adjust it for new scale settings:
https://github.com/pololu/vl6180x-arduino/blob/0f8fc0c40407607ab8613305905cc2ce6114e976/VL6180X.cpp#L251

I've submitted a pull request for this, and it has been approved. Not sure when it will be released, but you can probably find the new code and put the .h and .c onto your computer yourself...