LCD 8x2 0802A
Jump to navigation
Jump to search
0802-A LCD
Pinai
Pin nr | Tipas | Apibūdinimas | Jungimas |
---|---|---|---|
1 | Vss | Power supply (GND) | GND |
2 | Vdd | Power supply (+) | 5V |
3 | Vo | Contrast adjust | GND su 2k-10k resistoriumi |
4 | RS | Register select signal | Skaitmeninis pin |
5 | R/W | Data read / write | GND |
6 | E | Enable signal | Skaitmeninis pin |
7 | DB0 | Data bus line | Neprijungtas |
8 | DB1 | Data bus line | Neprijungtas |
9 | DB2 | Data bus line | Neprijungtas |
10 | DB3 | Data bus line | Neprijungtas |
11 | DB4 | Data bus line | Skaitmeninis pin |
12 | DB5 | Data bus line | Skaitmeninis pin |
13 | DB6 | Data bus line | Skaitmeninis pin |
14 | DB7 | Data bus line | Skaitmeninis pin |
Prijungimas prie Arduino UNO
Pin nr | Tipas | Apibūdinimas | Jungimas |
---|---|---|---|
1 | Vss | Power supply (GND) | GND |
2 | Vdd | Power supply (+) | 5V |
3 | Vo | Contrast adjust | GND su 2k-10k resistoriumi |
4 | RS | Register select signal | Arduino Pin 12 |
5 | R/W | Data read / write | GND |
6 | E | Enable signal | Arduino Pin 11 |
7 | DB0 | Data bus line | Neprijungtas |
8 | DB1 | Data bus line | Neprijungtas |
9 | DB2 | Data bus line | Neprijungtas |
10 | DB3 | Data bus line | Neprijungtas |
11 | DB4 | Data bus line | Arduino Pin 5 |
12 | DB5 | Data bus line | Arduino Pin 4 |
13 | DB6 | Data bus line | Arduino Pin 3 |
14 | DB7 | Data bus line | Arduino Pin 2 |
Kodas
#include <LiquidCrystal.h>
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(8, 2);
delay(3000);
// Print a message to the LCD
lcd.print("Hello!");
}
void loop() {
// set the cursor to column 0, line 1
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis() / 1000);
}
Prijungimas prie Wemos D1 Mini (esp8266)
Pin nr | Tipas | Apibūdinimas | Jungimas |
---|---|---|---|
1 | Vss | Power supply (GND) | GND |
2 | Vdd | Power supply (+) | 5V |
3 | Vo | Contrast adjust | GND su 2k-10k resistoriumi |
4 | RS | Register select signal | Wemos D1 |
5 | R/W | Data read / write | GND |
6 | E | Enable signal | Wemos D8 |
7 | DB0 | Data bus line | Neprijungtas |
8 | DB1 | Data bus line | Neprijungtas |
9 | DB2 | Data bus line | Neprijungtas |
10 | DB3 | Data bus line | Neprijungtas |
11 | DB4 | Data bus line | Wemos D4 |
12 | DB5 | Data bus line | Wemos D5 |
13 | DB6 | Data bus line | Wemos D6 |
14 | DB7 | Data bus line | Wemos D7 |
Kodas
#include <LiquidCrystal.h>
const int rs = D1, en = D8, d4 = D4, d5 = D5, d6 = D6, d7 = D7;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(8, 2);
delay(3000);
// Print a message to the LCD
lcd.print("Helloa!");
}
void loop() {
// set the cursor to column 0, line 1
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis() / 1000);
}