//-------------------------------------- //author:Victor Chen //web :www.vic8051.com //參考資料:Arduino實作入門與應用 ----台灣/松崗 //-------------------------------------- #include //引用程式庫 LiquidCrystal lcd(12, 11, 5, 4, 3, 2); //設定 lcd 腳位 void setup() { //初始化設定 lcd.begin(16, 2); //初始化lcd 介面,使用 2 行16 字元模式 lcd.print("hello, world1"); //顯示資料 } //----------------------------------- void loop()//主程式迴圈 { delay(1000); //延遲1秒 lcd.setCursor(0, 0);//設定游標於第一列起始位置 lcd.print("hello, world2"); delay(1000); //延遲1秒 lcd.setCursor(0, 1); //設定游標於第二列起始位置 lcd.print("test line2"); while(1); /無窮迴圈 }