// LCD1602 to Arduino Uno connection example
#include <LiquidCrystal.h>
const int BUTTON_PIN = 2;
LiquidCrystal lcd(12, 11, 10, 9, 8, 7);
void setup() {
lcd.begin(16, 2);
// you can now interact with the LCD, e.g.:
lcd.print("Hello World! iam study epu");
pinMode(BUTTON_PIN, INPUT_PULLUP);
}
void loop() {
if (digitalRead(BUTTON_PIN) == LOW) {
lcd.scrollDisplayLeft();
delay(500);
} else {
delay(500);
lcd.scrollDisplayRight();
}
}