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

If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.