简体   繁体   English

标识符“pinMode”未定义为什么我收到此错误

[英]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.

相关问题 为什么在使用AJAX / PHP时会收到未定义索引错误? - Why am I receiving an Undefined Index error when using AJAX/PHP? 无法读取推送未定义的属性? 即使我将评论推送到评论数组,为什么我会收到此错误? - Cannot read property of push undefined? Even though I am pushing comment to comments array why am I receiving this error? 为什么在定义的数组上收到“ ERROR TypeError:无法读取未定义的属性&#39;length&#39;的信息”? - Why am I receiving “ERROR TypeError: Cannot read property 'length' of undefined” on a defined array? 为什么我收到 TypeError:无法读取未定义的属性“执行” - Why am I receiving TypeError: cannot read property 'execute' of undefined 为什么我在这个高阶函数的例子中收到了undefined? - Why am I receiving undefined in this example of higher order functions? 为什么我收到无法读取未定义的属性“状态”? - Why am I receiving Cannot read property 'state' of undefined? 为什么会出现未定义的错误? - why am I getting an undefined error? 为什么在输入文本区域时出现替换功能错误 - Why am I receiving a replace function error when typing into a textarea 为什么我会收到这个 Invalid Hooks Call 错误? - Why am I receiving this Invalid Hooks Call error? 为什么我会收到无效的表单主体错误 Discord API? - Why am I receiving an Invalid Form Body error with Discord API?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM