Robofun 機器人論壇
標題:
LCD 16*2 顯示問題
[打印本頁]
作者:
小迪
時間:
2014-12-22 02:00
標題:
LCD 16*2 顯示問題
#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
int readkey;
int music=0;
void setup() {
lcd.begin(16, 2);
lcd.print("Welcome to Play");
}
void loop() {
lcd.setCursor(0, 1);
if(music<0) music=20;
lcd.print("Select ");
lcd.println(music);
lcd.print(" song");
readkey=analogRead(0);
if (readkey<50) { //
lcd.clear();
lcd.print("Music player");
delay(500);
}
else if(readkey<195) { //UP
lcd.clear();
music=music+1;
if(music>20) music=0;
lcd.print("Choosing music");
delay(500);
}
else if(readkey<380) { //Down
lcd.clear();
music=music-1;
lcd.print("Choosing music");
delay(500);
}
else if(readkey<790) { //
lcd.clear();
lcd.print("The music stops");
delay(500);
}
}
顯示出來的music值後面會有怪怪字 求解如何用掉
1222.jpg
(32.38 KB, 下載次數: 286)
下載附件
2014-12-22 02:00 上傳
歡迎光臨 Robofun 機器人論壇 (https://robofun.net/forum/)
Powered by Discuz! X3.2