05 Interfacing 16 *2 lcd display with arduino uno using proteus for displaying text , scrolling text

Опубликовано: 01 Май 2026
на канале: AL AMIN
199
6

Interfacing 16 *2 lcd display with arduino uno using proteus for displaying text , scrolling text and one after one displaying text .
The code for this given below.
1. Displaying text
#include LiquidCrystal.h

// Initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 4, 5, 6, 7);// RS, E, D4, D5, D6, and D7

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 (second row)
lcd.setCursor(0, 1);
// Print the number of seconds since reset:
lcd.print(millis() / 1000);
}

2.Now displaying the scrolling text
#include LiquidCrystal.h

// Initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 4, 5, 6, 7); // RS, E, D4, D5, D6, and D7

void setup() {
// Set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print initial messages to the LCD.
lcd.setCursor(0, 0);
lcd.print("Hello world ");
lcd.setCursor(0, 1);
lcd.print("Welcome the scrolling text representation");
delay(1000); // Delay to see the initial message
}

void loop() {
// Scroll both lines left
for (int position = 0; position less than 25; position++) {
lcd.scrollDisplayLeft();
delay(300); // Adjust delay for scrolling speed
}

// Pause before scrolling back
delay(1000);

// Scroll both lines right
for (int position = 0; position less than 25; position++) {
lcd.scrollDisplayRight();
delay(300); // Adjust delay for scrolling speed
}

// Pause before next loop
delay(1000);
}

3.screening the word one after one text
#include LiquidCrystal.h

// Initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 4, 5, 6, 7); // RS, E, D4, D5, D6, and D7

void setup() {
// Set up the LCD's number of columns and rows:
lcd.begin(16, 2);
}

void loop() {
// Array of pairs of strings to display
String messages[][2] = {
{"One 1", "Two 2"},// first screening as two line
{"Three 3", "Four 4"}, //second screening as two line
{"Five 5", "Six 6"},
{"Seven 7", "Eight 8"},
{"Nine 9", "Ten 10"}
};

// Number of message pairs
int numMessages = sizeof(messages) / sizeof(messages[0]);

// Display each pair of messages
for (int i = 0; i less than numMessages; i++) {
// Clear the display
lcd.clear();

// Set cursor and print the first message on the first row
lcd.setCursor(0, 0);
lcd.print(messages[i][0]);

// Set cursor and print the second message on the second row
lcd.setCursor(0, 1);
lcd.print(messages[i][1]);

// Pause to allow the messages to be read
delay(800); // Adjust delay as needed
}
}