I install necessary libraries using the PlatformIO library tools. I can see that they are installed using the PlatformIO library tools. I can see them in the platformio.ini. But the compiler can’t find them.
Here there is an include in Sensors.h to include PetesLCD.h Both places I get the errors regarding finding both libraries SoftWire.h and AsyncDelay.h Screen captures attached.
#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (C:\Users\peted\OneDrive\Documents\PlatformIO\Projects\210701-154821-megaatmega2560\src\Sensors.cpp).
cannot open source file “AsyncDelay.h” (dependency of “PetesLCD.h”)
First of all you need to check whether it’s a build error or not. If the project builds, it’s just an intellisense error and you need to rebuild the IntelliSense by doing a Ctrl+Shift+P → Rebuild IntellISense. Restarting VSCode and waiting for the intellisense rebuild also works, but is of course more unusual. If the project fails to compile, the libraries are not included correctly. I see you found out you problem fell in the first category.
You can also sanity-check that in the PlatformIO extension settings that “Auto Rebuild Autocomplete Index” is on (which should be the default), so the PlatformIO extension should auto-rebuild after adding a library.