2024-03-15 05:54 AM - last edited on 2024-03-15 07:12 AM by Peter BENSCH
I want to limpet VL53L5CX driver so i used VL53L5CX_SimpleRanging driver for reference.
so i can Enable USE_BARE_DRIVER ? and i got proper output?
or you can give any example code where USE_BARE_DRIVER used ,
so i can use it and implement.
Also below data is required to write
/* Download FW into VL53L5 */
status |= WrByte(&(p_dev->platform), 0x7fff, 0x09);
status |= WrMulti(&(p_dev->platform),0,
(uint8_t*)&VL53L5CX_FIRMWARE[0],0x8000);
status |= WrByte(&(p_dev->platform), 0x7fff, 0x0a);
status |= WrMulti(&(p_dev->platform),0,
(uint8_t*)&VL53L5CX_FIRMWARE[0x8000],0x8000);
status |= WrByte(&(p_dev->platform), 0x7fff, 0x0b);
status |= WrMulti(&(p_dev->platform),0,
(uint8_t*)&VL53L5CX_FIRMWARE[0x10000],0x5000);
status |= WrByte(&(p_dev->platform), 0x7fff, 0x01);
Solved! Go to Solution.
2024-03-18 07:02 AM
If you face that sensor exactly perpendicular to a will, all 16 zones should give you the same answer. We have converted the radial-to-perpendicular for you. No need to account for fact that the light travels farther to the edges than to the center.
If you only want one number, you are free to simply average them.
Although I think I'd do a weighted average. I'd give the 4 zones in the center more influence, and less influence to the outer zones. The theory being that what is directly in front of you is more important that the edges.
But it's entirely up to you.
- john
2024-03-15 08:29 AM
There seems to be an issue with understanding. In the Bare driver download you will get C:\...\VL53L5CX_ULD_driver_1.3.11
And in this directory is both the bare driver and some example code.
If you have purchased the P-Nucleo-53L5A1 (and I really recommend you do) you could use the code in CubeIDE_F401RE_Example to single step through a working example. And if you replace the main.c with one of the example codes in 'example' directory, you get many ways to run.
Even in you don't have the P-Nucleo-53L5A1, try downloading the STM32CubeIDE development system. It's free. Open the IDE and use the editor to simply follow the code. But if you have the P-Nucleo-53L5A1, you can single step through to the examples and really see what is happening.
And those big writes are mandatory. The sensor has a pretty amazing MCU in it, and you are downloading the firmware. (And a word of warning - lots of MCUs do not have the ability to do 0x8000 byte I2C writes. Might have to break that up.)
2024-03-18 01:38 AM
Hi,
Thank you for your quick response.
I used Zone mapping 4x4,
There are 16 zones and each zone give me distance value in mm,
so how i can find final distance value?I want to do averaging?
2024-03-18 07:02 AM
If you face that sensor exactly perpendicular to a will, all 16 zones should give you the same answer. We have converted the radial-to-perpendicular for you. No need to account for fact that the light travels farther to the edges than to the center.
If you only want one number, you are free to simply average them.
Although I think I'd do a weighted average. I'd give the 4 zones in the center more influence, and less influence to the outer zones. The theory being that what is directly in front of you is more important that the edges.
But it's entirely up to you.
- john