Presentation is loading. Please wait.

Presentation is loading. Please wait.

智慧電子應用設計導論(1/3) Display

Similar presentations


Presentation on theme: "智慧電子應用設計導論(1/3) Display"— Presentation transcript:

1 智慧電子應用設計導論(1/3) Display
Chin-Shiuh Shieh (謝欽旭) Department of Electronic Engineering National Kaohsiung University of Applied Sciences, Taiwan TA:范家禎、姜丞俞 Autumn, 2015 C.-S. Shieh, EC, KUAS, Taiwan

2 Character LCD 文字形LCD 文字形LCD LCD 總共有 14 支接腳,如果內建背光的話是 16 支。 腳位編號 名稱 說明
Vss 接地 (0V) 2 Vdd 電源 (+5V) 3 Vo 或稱 Vee 對比(0-5V), 可接一顆 1k 電阻,或利可變電阻調整適當的對比 4 RS Register Select:  1:D0 – D7 當作資料解釋  0:D0 – D7 當作指令解釋 5 R/W Read/Write mode:  1:從 LCD 讀取資料  0:寫資料到 LCD  6 E Enable 7 D0 Bit 0 LSB 8 D1 Bit 1 9 D2 Bit 2 10 D3 Bit 3 11 D4 Bit 4 12 D5 Bit 5 13 D6 Bit 6 14 D7 Bit 7 MSB 15 A+ 背光(串接 330R 電阻到電源) 16 K- 背光(GND) 文字形LCD 文字形LCD LCD 總共有 14 支接腳,如果內建背光的話是 16 支。

3 Character LCD (cont) #include <LiquidCrystal.h>
LiquidCrystal lcd(2,3,4, 14,15,16,17,18,19,20,21); void setup() { lcd.begin(16, 2); Serial.begin(9600); } void loop() { lcd.clear(); lcd.print(analogRead(A0)); delay(100);

4 Graphic LCD Module 繪圖形LCD 腳位編號 名稱 說明 1 Vss 接地 (0V) 2 Vdd 電源 (+5V) 3 Vo
對比(0-5V), 可接一顆 1k 電阻,或利可變電阻調整適當的對比 4 A0 1:D0 – D7 當作資料解釋  0:D0 – D7 當作指令解釋 5 /CS1 0:chip1 Enable 6 /CS2 0:chip2 Enable 7 CL External 2KHz clock 8 E Enable 9 R/W 1:從 LCD 讀取資料  0:寫資料到 LCD  10 D0 Bit 0 LSB 11 D1 Bit 1 12 D2 Bit 2 13 D3 Bit 3 14 D4 Bit 4 15 D5 Bit 5 16 D6 Bit 6 17 D7 Bit 7 MSB 18 /RST LH Reset LCM 19 A 背光(5V) 20 K 背光(GND) 繪圖形LCD

5 Graphic LCD – SSC12A32DRG

6 Color LCD Shield Nokia 6100 LCD LCD Pin Arduino Pin Reset (RES) 8
Chip-select 9 Data in/out (DIO) 11 Serial Clock (SCK) 13

7 Color LCD Shield

8 FlamingoEDA JoyStick 二維搖桿 可以用來對控制物體在二維平面內(X和Y方向)的運動,控制桿由兩個電位器和一個按鈕組成。
兩個電位器的輸入值分別用來表示在X和Y軸上的偏移量,其類型為類比值;而按鈕則用來表示是否在Z軸上按下,其類型為數位值。

9 LED Matrix

10 LED Matrix (cont) // Pin assignmnet
int y[16]={0,1,2,3,4,5,6,7,14,15,16,17,18,19,20,21}; int x[16]={22,24,26,28,30,32,34,36,39,41,43,45,47,49,51,53}; void setup() { for(int i=0;i<16;i++) { pinMode(y[i],OUTPUT);digitalWrite(y[i],LOW); pinMode(x[i],OUTPUT);digitalWrite(x[i],HIGH); }

11 LED Matrix (cont) void loop() { int x_value=1024-analogRead(A0);
int y_value=analogRead(A1); for(int i=0;i<16;i++) { if(y_value/64==i) digitalWrite(y[i],HIGH); else analogWrite(y[i],LOW); if(x_value/64==i) digitalWrite(x[i],LOW); digitalWrite(x[i],HIGH); }


Download ppt "智慧電子應用設計導論(1/3) Display"

Similar presentations


Ads by Google