Robofun 機器人論壇
標題:
偵錯問題
[打印本頁]
作者:
mjm2246
時間:
2012-3-5 19:59
標題:
偵錯問題
#include <LiquidCrystal.h>
int sensorValue1 = 0;
int sensorValue2 = 0;
LiquidCrystal lcd(3, 4, 5, 8, 9, 10, 11); //初始化LCD
void setup()
{
Serial.begin(9600);
}
void loop() {
sensorValue1 = analogRead(0);
sensorValue2 = analogRead(1);
Serial.print("Value = " );
Serial.println(sensorValue1,sensorValue2);
lcd.begin(16, 2); //設定LCD大小
lcd.setCursor(0,0);
lcd.print(sensorValue1); //輸出字串
lcd.setCursor(0,1)
lcd.print(sensorValue2);
delay(100);
}
顯示這樣的錯誤是什麼意思
sketch_mar05a.cpp: In function 'void loop()':
sketch_mar05a:19: error: expected `;' before 'lcd'
作者:
mzw2008
時間:
2012-3-6 00:02
lcd.setCursor(0,1)
後面要加分號
分號是C語言規定的指令結束
歡迎光臨 Robofun 機器人論壇 (https://robofun.net/forum/)
Powered by Discuz! X3.2