我刚买了一台Arduino UNO R3,我正在试着让一个小的发光二极管每隔一秒闪烁一次。但每次我尝试验证或上传代码时,都会得到相同的错误:"Error compiling for board Arduino/Genuino Uno“。我选择了正确的主板和端口,并且正确连接了LED。任何帮助都是非常感谢的。
代码如下:
void setUp()
{
pinMode(13, OUTPUT);
}
void loop()
{
digitalWrite(13, HIGH);
delay(1000);
digitalWrite(13, LOW);
delay(1000);
}发布于 2019-10-23 05:04:44
你遗漏了大概4/5的错误信息。
未定义对“`setup”的引用
是其中的一部分。
将setUp重命名为setup,它将进行编译。
请参阅Arduino TUTORIALS > Built-In Examples > 01.Basics > BareMinimum
这个示例包含了在Arduino Software (集成开发环境)上正确编译草图所需的最少代码:
setup()方法和loop()方法。
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}发布于 2019-10-23 05:30:16
你打错了。它需要是:
void setup() {
}看看这个:https://www.arduino.cc/reference/en/language/structure/sketch/setup/
IDE找不到安装函数,这就是问题所在。
https://stackoverflow.com/questions/58507697
复制相似问题