#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
String line1 = "HI, JOJIN";
String line2 = "I AM ANEESH KUMAR P B. I WELCOMES YOU TO MY NEW PROJECT";
int pos = 0;
void setup() {
Wire.begin(21, 22);
lcd.init();
lcd.backlight();
// Fixed first line
lcd.setCursor(0, 0);
lcd.print(line1);
}
void loop() {
lcd.setCursor(0, 1);
// Print only 16 chars of line2
lcd.print(line2.substring(pos, pos + 16));
pos++;
if (pos > line2.length() - 16) {
pos = 0;
}
delay(900); // adjust scroll speed
}