1

i am trying to run aurdino ide with vs code but i am receiving this error why ??

[![enter image description here][1]][1]

#define LED_BUILTIN= 2


void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}
codeit_9038
  • 35
  • 1
  • 3
  • Well, do not understand the downvoting, I have the very same problem and can't solve that... It seems as some C/CPP configuration problem or arduino-cli problem. Together with this one, every second build fails with problem for me that its missing configuration, but the configuration is removed after this unsuccessful build, otherwise it is in there... Another problem for me is that including libraries is more difficult than my brain can catch and understand. I would simply say, C/CPP is not very developer friendly :) – tomdelahaba Oct 14 '22 at 18:52

3 Answers3

1

Vscode doesn't know you are using Arduino. pinMode is not imported so it doesn't know what it is. You need to set vscode up appropriately you can read more for example here: https://maker.pro/arduino/tutorial/how-to-use-visual-studio-code-for-arduino

vfioox
  • 730
  • 1
  • 8
  • 22
1

Not sure what your error is, but try adding #include <Arduino.h>

Also, do you have platform io installed in vscode? If so, need to see your platformio.ini config file, and also the board you've configured, and what board you actually have. LED_BUILTIN from the top of my head is a FireBeetle... but could be something else.

Need more info.

KRK Owner
  • 762
  • 7
  • 16
0

For me, I had to use the command C/C++: Select a configuration... and choose Arduino.

Markus Appel
  • 3,138
  • 1
  • 17
  • 46