cancel
Showing results for 
Search instead for 
Did you mean: 

Interface VL53L0X with PIC18LF47K42 micro controller

DuyHoang
Associate

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,

3 REPLIES 3
Andrew Neil
Evangelist III

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:

AndrewNeil_0-1706721508509.png

 

To get that extra row of icons, press this button:

AndrewNeil_1-1706721508505.png

 

 

Hi Andrew,

I have that file in the folder core\inc, and I have added it to the header files of my project.

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.