cancel
Showing results for 
Search instead for 
Did you mean: 

Visual Code is not recognizing "windows.h" from "vl53l0x_platform.c" of VL53L0X's API. How should I proceed about this?

COroz.1
Associate

0693W000008zj8JQAQ.png

1 REPLY 1
John E KVAM
ST Employee

The platform.c as delivered communicates from the sensor to your PC. It's not what you want. You want to commicate from the sensor to your MCU.

So the trick is to completely gut that file, leaving only the function calls. Then re-write the functions to communicate with the I2C functions of your MCU.

It's kind of a pain.

I'd go to GitHub and do a search for the VL53L and your MCU. Lots of people post and all of them have done this before you.

Another way to go - if you are using an STM32 is download the code for the VL53L1X UltraLite Driver. It has in it an example project. That example project contains a VL53L1X_Platform.c

You can adapt that platform.c to you your VL53L0_platform.c

  • john

Our community relies on fruitful exchanges and good quality content. You can thank and reward helpful and positive contributions by marking them as 'Accept as Solution'. When marking a solution, make sure it answers your original question or issue that you raised.

ST Employees that act as moderators have the right to accept the solution, judging by their expertise. This helps other community members identify useful discussions and refrain from raising the same question. If you notice any false behavior or abuse of the action, do not hesitate to 'Report Inappropriate Content'