Liquid Crystal Display 16×2
As we all know, though LCD and some other displays greatly enrich the man-machine interaction, they share a common weakness. When they are connected to a controller, multiple IOs will be occupied of the controller which has no so many outer ports. Also it restricts other functions of the controller.
PIN Connections
LCD1602 Arduino | LCD1602 Arduino |
VSS->GND | D5 ->D4 |
VDD ->+5V | D6 ->D3 |
VO ->10K Potentiometer | D7 ->D2 |
RS ->D12 | A ->220/330Ω |
RW ->GND | K ->GND |
E ->D11 |
Arduino Code
// initialize the library with the numbers of the interface pins
#include<LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup()
{
// set up the LCD’s number of columns and rows:
lcd.begin(16,2);
// Print a message to the LCD.
lcd.print(“CAN YOU SMELL WHAT THE ROCK “);
lcd.setCursor(0,1); //Display position
lcd.print(“IS COOKING”);
}
void loop()
{
// Turn off the display:
lcd.noDisplay();
delay(500);
// Turn on the display:
lcd.display();
delay(500);
}