Arduino错误:“;在'之前应为不合格id;其他'&引用;
在编译过程中,我在第23行收到一个“在'else'之前预期的非限定id”错误,下面的**突出显示,我不确定如何解释它的含义。对它意味着什么有什么想法Arduino错误:“;在'之前应为不合格id;其他'&引用;,arduino,Arduino,在编译过程中,我在第23行收到一个“在'else'之前预期的非限定id”错误,下面的**突出显示,我不确定如何解释它的含义。对它意味着什么有什么想法 void loop(){ 如果(cycleTally您应该开发自己的风格或规程来格式化代码,以便清楚地看到括号是如何配对的: void loop() { if (cycleTally <= 3) {
void loop(){
如果(cycleTally您应该开发自己的风格或规程来格式化代码,以便清楚地看到括号是如何配对的:
void loop()
{
if (cycleTally <= 3)
{
for (count = 0, cycleTally = 0; count < 3 && cycleTally == count++,cycleTally++)
{
digitalWrite(led, LOW); //LED is dim for 250 ms
delay (timeBlockArrayShort[count]); //count = 1 in the array, 250 ms
digitalWrite(led, HIGH); //LED is bright for 250 ms
delay (timeBlockArrayShort[count + 1]); //count = 2 in the array, 250 ms
} // end for
} else { //error location ??
if (cycleTally <= 6)
{
for (count = 0, cycleTally = 4; count<3 && cycleTally==6;count++,cycleTally++)
{
digitalWrite(led, LOW);
delay (timeBlockArrayLong[count]);
digitalWrite(led, HIGH);
delay (timeBlockArrayLong[count + 1]);
} // end for
}
} ///<<<<< THIS WAS MISSING after formatting!!!
void循环()
{
if(cycleTally)这正是你的代码吗?似乎(我猜…)在“}”和“else”之间或者在它之前有一个额外的“{”或“}”错误。你在哪里关闭loop()函数?对于这种错误,我会让loop()为空,然后尝试编译,首先添加带有空块的if(),然后尝试编译,添加For()使用空块…等等,直到我发现有问题的块,然后应该更容易看到错误在哪里(即使是在使用“自定义”宏的情况下逐行)。是的…它是包含错误的代码的一部分。直到“else”编译为止的第一部分。我只是不知道错误消息试图告诉我什么。
void loop()
{
if (cycleTally <= 3)
{
for (count = 0, cycleTally = 0; count < 3 && cycleTally == count++,cycleTally++)
{
digitalWrite(led, LOW); //LED is dim for 250 ms
delay (timeBlockArrayShort[count]); //count = 1 in the array, 250 ms
digitalWrite(led, HIGH); //LED is bright for 250 ms
delay (timeBlockArrayShort[count + 1]); //count = 2 in the array, 250 ms
} // end for
} else { //error location ??
if (cycleTally <= 6)
{
for (count = 0, cycleTally = 4; count<3 && cycleTally==6;count++,cycleTally++)
{
digitalWrite(led, LOW);
delay (timeBlockArrayLong[count]);
digitalWrite(led, HIGH);
delay (timeBlockArrayLong[count + 1]);
} // end for
}
} ///<<<<< THIS WAS MISSING after formatting!!!