【发布时间】:2012-04-09 07:11:58
【问题描述】:
当我尝试编译我的代码时出现此错误:
需要左值作为赋值的左操作数。
代码正在通过模拟端口读取按钮。这是错误所在(在 void(loop) 中):
while (count < 5){
buttonPushed(analogPin) = tmp;
for (j = 0; j < 5; j++) {
while (tmp == 0) { tmp = buttonPushed(analogPin); } //something wrong with the first half of this line!
if(sequence[j] == tmp){
count ++;
}
else {
lcd.setCursor(0, 1); lcd.print("Wrong! Next round:"); delay(1000);
goto breakLoops;
}
}
}
breakLoops:
elapsedTime = millis() - startTime;
在最上面我有:int tmp;
【问题讨论】:
标签: c loops while-loop arduino