I’m running into a small collection of issues that I can’t seem to nail down, using VSCode, PlatformIO, and the Arduino framework:
For reference, my platformio.ini file:
[env:uno] platform = atmelavr board = uno framework = arduino lib_deps= TimerOne FastLED build_flags = -I"C:/Users/<MyUsername>/.platformio/packages/toolchain-atmelavr/avr/include"
First, VSCode seems unhappy about any
#include <Arduino.h> because it complains about
cannot open source file "avr/pgmspace.h" (dependency of "Arduino.h"). I’ve explicitly added the framework to the .ini file, I don’t know what else I’m missing to get Intellisense to correctly include the avr headers.
I’ve found I can resolve this first issue by adding the directory in my
build_flags directly to the
c_cpp_properties.json file, but of course PlatformIO overwrites this all the time. However for the life of me I can’t figure out how to get the build_flags in platformio.ini to actually add this directory. I’ve tried quotes, no quotes, forward slash, backward slash… What am I missing?