2

I've installed C++ and Arduino extensions for my VS code, and most of it seem to work (it tries to connect to a board, for example), but the language recognition and IntelliSense keep marking Arduino keywords as errors and doesn't complete anything that isn't pure C++. what am I doing wrong? enter image description here

Edit: I've figured out where things go wrong. the C++ configuration is set to Win32, but the Arduino config does not exist. it isn't in the json either. seems like the arduino extension failed to modify the c_cpp_properties.json, but still I can't fix it because i don't know what is supposed to be the content of the json.

young marx
  • 378
  • 1
  • 2
  • 15
  • 3
    Those are not keywords, but functions (`pinMode()`, `digitalWrite`) or macros (`OUTPUT`, `HIGH`). – Ulrich Eckhardt Jun 10 '22 at 06:47
  • You can try `#include ` – KIIV Jun 10 '22 at 06:54
  • @KIIV i get the error cannot open source file "Arduino.h". but thats the only error. I've narrowed down the problem to the C++ config manu, its set to Win32 and there's no Arduino option available. couldn't find the arduino section in the json either. – young marx Jun 10 '22 at 07:41

1 Answers1

0

The solution that finally worked for me was to open an example (the arduino package comes with examples). then i chose a board and verified the code, the json file called c_cpp_properties, that up until now only had the configuration for Win32, was modified to contain the configs needed for arduino. its been e journey.

young marx
  • 378
  • 1
  • 2
  • 15