我得到這個錯誤,當我試圖編譯我的代碼「要求作爲轉讓的左操作數左值」:Arduino的代碼編譯錯誤:
lvalue required as left operand of assignment.
的代碼是雖然模擬端口的按鈕閱讀。這是錯誤的是(空隙(循環)):
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;
非常感謝Ouah某個位置分配的代碼。這似乎是完美的。 :-) – user1291351 2012-03-25 18:00:52
@ user1291351不客氣! – ouah 2012-03-25 18:17:41