Sale!

4*20 LCD

SKU: PE - 128 Category: Tag:

Description

A?20×4?LCD means it can display 20 characters per line and there are 4 such lines. In this LCD each character is displayed in 5×7 pixel matrix.

A 20×4 LCD?show?is very?fundamental?module and is very?usually?used in?a number?units?and circuits. These modules are?desired?over seven segments and?different?multi?phase?LEDs. The?motives?being: LCDs are economical;?without problems?programmable; have no?quandary?of?exhibiting?extraordinary?& even?customized?characters (unlike in seven segments), animations and so on.

A 20×4 LCD?capability?it can?show?20 characters per line and there are?four?such lines. In this LCD?every?personality?is displayed in 5×7 pixel matrix. This LCD has two registers, namely, Command and Data. This is?fashionable?HD44780 controller LCD.

REQUIREMENTS:

There is no?exchange?code for interfacing?general?16×2 or 20×4 LCD.

20 Characters x?four?Lines
Built-in HD44780 Equivalent LCD Controller
Works?without delay?with ATMEGA, ARDUINO, PIC amd many?different?microcontroller/kits.
4 or?eight?bit?statistics?I/O interface
Low?strength?consumption

 

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <DS1307RTC.h>
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD I2C address
byte verticalLine[8] = {
B00100,
B00100,
B00100,
B00100,
B00100,
B00100,
B00100,
B00100
};
byte char2[8] = {
B00000,
B00000,
B00000,
B11100,
B00100,
B00100,
B00100,
B00100
};
byte char1[8] = {
0b00000,
0b00000,
0b00000,
0b00111,
0b00100,
0b00100,
0b00100,
0b00100
};
byte char3[8] = {
0b00100,
0b00100,
0b00100,
0b00111,
0b00000,
0b00000,
0b00000,
0b00000
};
byte char4[8] = {
0b00100,
0b00100,
0b00100,
0b11100,
0b00000,
0b00000,
0b00000,
0b00000
};
void setup()
{
lcd.begin(20,4);
createCustomCharacters();
printFrame();
}
void loop()
{
tmElements_t tm;
if (RTC.read(tm)) {
printDate(5,1,tm);
printTime(6,2,tm);
} else {
if (RTC.chipPresent()) {
} else {
}
delay(9000);
}
delay(1000);
}
void printTime(int character,int line, tmElements_t tm)
{
String seconds,minutes;
lcd.setCursor(character,line);
lcd.print(tm.Hour);
lcd.print(“:”);
if(tm.Minute<10)
{
minutes = “0”+String(tm.Minute);
lcd.print(minutes);
}else
{
lcd.print(tm.Minute);
}
lcd.print(“:”);
if(tm.Second<10)
{
seconds = “0”+String(tm.Second);
lcd.print(seconds);
}else
{
lcd.print(tm.Second);
}
}
void printDate(int character,int line, tmElements_t tm)
{
lcd.setCursor(character,line);
lcd.print(tm.Month);
lcd.print(“/”);
lcd.print(tm.Day);
lcd.print(“/”);
lcd.print(tmYearToCalendar(tm.Year));
}
void printFrame()
{
lcd.setCursor(1,0);
lcd.print(“——————“);
lcd.setCursor(1,3);
lcd.print(“——————“);
lcd.setCursor(0,1);
lcd.write(byte(0));
lcd.setCursor(0,2);
lcd.write(byte(0));
lcd.setCursor(19,1);
lcd.write(byte(0));
lcd.setCursor(19,2);
lcd.write(byte(0));
lcd.setCursor(0,0);
lcd.write(byte(1));
lcd.setCursor(19,0);
lcd.write(byte(2));
lcd.setCursor(0,3);
lcd.write(byte(3));
lcd.setCursor(19,3);
lcd.write(byte(4));
}
void createCustomCharacters()
{
lcd.createChar(0, verticalLine);
lcd.createChar(1, char1);
lcd.createChar(2, char2);
lcd.createChar(3, char3);
lcd.createChar(4, char4);
}

Customer Reviews

There are no reviews yet.

Be the first to review “4*20 LCD”

This site uses Akismet to reduce spam. Learn how your comment data is processed.