How to include Arduino Library in PlatformIO?

This is the correct way.

Make sure to build the project once and rebuild the intellisense (Ctrl+Shift+P → Rebuild IntelliSense).

If you are mixing .c with .cpp code, odn’t forget to add the standard extern "C" declarations.

2 Likes