2024-01-07 08:50 PM
Hi.
Regarding the VL53L7CX, I downloaded STSW-IMG036 (API Source) from the product page and tried running the Nucleo board and sensor using the example project included there. However, the default sensor operation setting in the code is 16(4×4) zones, but I don’t know exactly how to change it to 64(8×8) zones.
In the user manual
They say it can be changed in vl53l7cx_set_resolution(), but there is no detailed explanation, so it is currently not possible to modify it. It may be because I don't know C language well, but please help me with a detailed explanation.
https://www.st.com/en/embedded-software/stsw-img036.html
Solved! Go to Solution.
2024-01-09 07:19 PM
It seems like you should be able to just insert a line to call the function like this, immediately after vl53l7cx_init():
printf("Sensor initializing, please wait few seconds\n");
status = vl53l7cx_init(&Dev);
status = vl53l7cx_set_resolution(&Dev, VL53L7CX_RESOLUTION_8X8);
status = vl53l7cx_set_ranging_frequency_hz(&Dev, 2); // Set 2Hz ranging frequency
status = vl53l7cx_set_ranging_mode(&Dev, VL53L7CX_RANGING_MODE_CONTINUOUS); // Set mode continuous
If you still have trouble, hopefully someone else can offer more help as unfortunately I'm not very familiar with the Nucleo.
2024-01-09 05:53 PM
Have you looked at Example_2_get_set_params.c from the API? That example sets the resolution to 8x8.
2024-01-09 06:08 PM
First of all, thank you for your opinion.
you're right. From the example code in the material, I was able to see that it operates in 8×8 mode.
However, I am not yet skilled enough to know exactly how to use this code on the Nucleo board.
I tried to combine the example project and the example code, but it wasn't easy.
Is there a way to change the example project in the 'CubeIDE_F401RE_Example' folder to 8×8 mode by changing parameter values?
2024-01-09 07:19 PM
It seems like you should be able to just insert a line to call the function like this, immediately after vl53l7cx_init():
printf("Sensor initializing, please wait few seconds\n");
status = vl53l7cx_init(&Dev);
status = vl53l7cx_set_resolution(&Dev, VL53L7CX_RESOLUTION_8X8);
status = vl53l7cx_set_ranging_frequency_hz(&Dev, 2); // Set 2Hz ranging frequency
status = vl53l7cx_set_ranging_mode(&Dev, VL53L7CX_RANGING_MODE_CONTINUOUS); // Set mode continuous
If you still have trouble, hopefully someone else can offer more help as unfortunately I'm not very familiar with the Nucleo.
2024-01-09 07:43 PM
Wow, thank you so much. I modified it as you suggested and it works perfectly.