[英]identifier "pinMode" is undefined why i am receiving this error
i am trying to run aurdino ide with vs code but i am receiving this error why ??我正在尝试使用 vs 代码运行 aurdino ide,但我收到此错误,为什么?
[![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 }
Vscode doesn't know you are using Arduino. Vscode 不知道您使用的是 Arduino。 pinMode is not imported so it doesn't know what it is.
pinMode 没有被导入,所以它不知道它是什么。 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
您需要适当地设置 vscode,您可以在此处阅读更多信息: https ://maker.pro/arduino/tutorial/how-to-use-visual-studio-code-for-arduino
Not sure what your error is, but try adding #include <Arduino.h>不确定您的错误是什么,但尝试添加 #include <Arduino.h>
Also, do you have platform io installed in vscode?另外,你在vscode中安装了平台io吗? If so, need to see your platformio.ini config file, and also the board you've configured, and what board you actually have.
如果是这样,需要查看您的 platformio.ini 配置文件,以及您配置的板,以及您实际拥有的板。 LED_BUILTIN from the top of my head is a FireBeetle... but could be something else.
我头顶上的 LED_BUILTIN 是 FireBeetle……但可能是别的东西。
Need more info.需要更多信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.