LCD 16X2
LCD 16X2
Designed By :
Mr. Sumeet Prashar
Assistant Professor (ECE) 1
16X2 LCD
2
16X2 LCD
The interface consists of the following pins:
• A register select (RS) pin that controls where in the LCD's memory you're
writing data to. You can select either the data register, which holds what
goes on the screen, or an instruction register, which is where the LCD's
controller looks for instructions on what to do next.
• A Read/Write (R/W) pin that selects reading mode or writing mode
• An Enable pin that enables writing to the registers
• 8 data pins (D0 -D7). The states of these pins (high or low) are the bits that
you're writing to a register when you write, or the values you're reading
when you read.
• There's also a display contrast pin (Vo), power supply pins (+5V and
GND) and LED Backlight (Bklt+ and BKlt-) pins that you can use to
power the LCD, control the display contrast, and turn on and off the LED
backlight, respectively.
• LCDs can be controlled in two modes: 4-bit or 8-bit. The 4-bit mode
requires less I/O pins from the Arduino, while the 8-bit mode requires more
pins. For displaying text on the screen, you can do most everything in 4-bit
mode, so example shows how to control a 16x2 LCD in 4-bit mode.
• There's also a display contrast pin (Vo), power supply pins (+5V and
GND) and LED Backlight (Bklt+ and BKlt-) pins that you can use to
power the LCD, control the display contrast, and turn on and off the LED
backlight, respectively.
3
#include <LiquidCrystal.h> // include the library code:
LiquidCrystal lcd(13, 12, 8, 9, 10, 11); // (rs, en, d4, d5, d6, d7);
void setup()
{
lcd.begin(16, 2); // set up the LCD's number of columns and rows:
Void loop()
{
lcd.setCursor(0,1); // set the cursor to column 0, Second Row
lcd.print("hello, Everyone"); // Print a message to the LCD.
delay(2000);
lcd.clear(); // Clear the contents of LCD
lcd.setCursor(0,0);
lcd.print(“Welcome");
delay(2000);
lcd.clear();
}
4
Controlling LED Brightness using PWM
feature