I have just installed PlatformIO today and wanted to use a code with “Servo.h”, however even if my LSP works and has the path to it my project won’t build.
I first added lib_deps=arduino-libraries/Servo@^1.2.1 under [env:uno] and this was not even recognized by the LSP though it was downloaded under .pio/libdeps.
I then put it under [env] and now it is somewhat accepted by the LSP, I can CTRL+Click in order to get to the source file. But it will still not compile.
#include <Arduino.h>
#include <Servo.h>
Servo servo;
void setup() {
// put your setup code here, to run once:
//int result = myFunction(2, 3);
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(LED_BUILTIN, HIGH);
delay(1000);
digitalWrite(LED_BUILTIN, LOW);
delay(1000);
}
And here is the end of the compilation process, before are warnings :
There is nothing special about that /mnt folder, it’s not WSL nor a devcontainer.
After deleting the .pio folder I pressed again CTRL+ALT+B to build and I am still getting the same error.
Deleting the folder again then executing PlatformIO: Rebuild IntelliSense Index does not work either.
Have you tried to create a clean project somewhere in the regular /home/ directory? Have you disabled all extensions except C/C++ by Microsoft and PlatformIO? You are using the regular VSCode and not VSCodium / OSS VSCode?
I am indeed using VSCodium and that might be the issue, I did install the C/C++ extension by Microsoft through the VSIX file. Is there anything else I should do to make PlatformIO work ?