2024-01-31 08:46 AM - last edited on 2024-07-03 06:56 AM by Peter BENSCH
Hi all,
I am trying to use a PIC18LF47K42 to read the distance from the Light Ranger 2 click board, which uses the sensor VL53L0X.
I copy two folders: core and platform, which are inside the folder en.STSW-IMG005\VL53L0X_1.0.4\Api
I add these file into the project header files and source files
In the main.c, I try to call only one function VL53L0X_DataInit(); same as below
void main(void)
{
VL53L0X_DataInit();
while(1)
{
}
}
The problem is that I cannot compile. The MPLabX shows the below error:
./../../Year2/MGMT102/0-Datasheet/01-ST_VL6180/API/en.STSW-IMG005/VL53L0X_1.0.4/Api/core/src/vl53l0x_api_core.c:29:10: fatal error: 'vl53l0x_api.h' file not found
#include "vl53l0x_api.h"
^~~~~~~~~~~~~~~
1 error generated.
(908) exit status = 1
Could you please advise on a solution to the issue?
Thanks,
2024-01-31 09:18 AM
So it's telling you that it can't find the file 'vl53l0x_api.h'
Do you actually have that file anywhere on your system?
Use this button to properly post source code:
To get that extra row of icons, press this button:
2024-01-31 11:09 AM
Hi Andrew,
I have that file in the folder core\inc, and I have added it to the header files of my project.
2024-01-31 02:58 PM
The message says that the compiler can't find it.
As the file does exist, then the problem must be in your Include Paths - ie, you are not directing the compiler to look in the correct place.