Today I share how to connect LCD1602 with Arduino Nano and Potentiometer.
LCD1602
LCD1602 means an LCD that has a display for 2 lines of characters in 16 columns. It can display numbers, letters, symbols, ASCII code, etc.This is a monochrome LCD1602 display screen:
VSS (Pin 1) : Negative electrode of power supply
VDD (Pin 2) :Positive electrode of power supply, the voltage is 5V
V0 (Pin 3) : Contrast and adjust the display effect
RS (Pin 4) : Data/Command selection
R/W (Pin 5) : Read/Write selection
E (Pin 6) : Enable pin
D0-D7 (Pin 7-14) : Data pin
LED+ (Pin 15) : Positive electrode of backlight LED, the voltage is 5V
LED- (Pin 16) : Negative electrode of backlight LED
Here is the result:
Here is the code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
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("hello, world!");
}
void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print("Counter:");
lcd.print(millis() / 1000);
}
No comments:
Post a Comment
Please kindly give nice comment that can improve our website in the future.
Thank you.
Regards,
DIY4 Pro