Presentation is loading. Please wait.

Presentation is loading. Please wait.

Arduino課程 液晶1602 中部自造者基地-雲科大.

Similar presentations


Presentation on theme: "Arduino課程 液晶1602 中部自造者基地-雲科大."— Presentation transcript:

1 Arduino課程 液晶1602 中部自造者基地-雲科大

2 實驗目的 利用1602 LCD 點陣液晶模組,顯示簡單的文字。 中部自造者基地-雲科大

3 先備知識 左上角 lcd.setCursor ( 0 , 0 ); 右下角 lcd.setCursor ( 0 , 1 ); 16 x 2格
LED燈 lcd.scrollDisplayLeft(); 中部自造者基地-雲科大

4 架設圖 GND> GND VCC>> 5V SDA>>A4 SCL>>A5 中部自造者基地-雲科大

5 程式碼 #include <Wire.h> #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27,16,2); void setup() { //LCD初始化 lcd.init(); //清除先前畫面 lcd.clear(); } void loop() lcd.setBacklight (HIGH); lcd.setCursor ( 0 , 0 ); lcd.print ( "Arduino is fun." ); lcd.setCursor (3, 1 ); //第二列的游標由第三格開始 lcd.print ( "Keep moving." ); 中部自造者基地-雲科大

6 程式碼_跑馬燈 #include <Wire.h> #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27,16,2); void setup() { //LCD初始化 lcd.init(); //清除先前畫面 lcd.clear(); lcd.print ( "Arduino is fun and so cool." ); } void loop() lcd.setBacklight (HIGH); lcd.setCursor ( 0 , 0 ); lcd.scrollDisplayLeft(); delay(400); 中部自造者基地-雲科大

7 顯示氣體偵測狀態 中部自造者基地-雲科大

8 #include <Wire. h> #include <LiquidCrystal_I2C
#include <Wire.h> #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27,16,2); int airq; void setup() { //LCD初始化 lcd.init(); //清除先前畫面 lcd.clear(); Serial.begin(9600); } void loop() int sensorvalue=analogRead(A0); lcd.setBacklight (HIGH); lcd.setCursor ( 0 , 0 ); lcd.print ("pollution:"); lcd.setCursor (11 , 0 ); lcd.print ( sensorvalue ); delay(500); //lcd.setCursor (3, 1 ); //第二列的游標由第三格開始 //lcd.print ( "Keep moving." ); 中部自造者基地-雲科大


Download ppt "Arduino課程 液晶1602 中部自造者基地-雲科大."

Similar presentations


Ads by Google