Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offset registry missing #21

Open
ajsb85 opened this issue Jun 2, 2021 · 11 comments
Open

Offset registry missing #21

ajsb85 opened this issue Jun 2, 2021 · 11 comments

Comments

@ajsb85
Copy link

ajsb85 commented Jun 2, 2021

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

@ladyada
Copy link
Member

ladyada commented Jun 2, 2021

pull requests are welcome!

@DanielMartensson
Copy link

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.

@ajsb85
Copy link
Author

ajsb85 commented Jun 25, 2021

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.

@DanielMartensson
Copy link

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

@DanielMartensson
Copy link

@ajsb85

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

@caternuson
Copy link
Contributor

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?

@DanielMartensson
Copy link

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

@caternuson
Copy link
Contributor

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.

@DanielMartensson
Copy link

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?

@caternuson
Copy link
Contributor

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

@amitrao17
Copy link
Contributor

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants