#include <LiquidCrystal.h>
// Initialze the connected pins
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Mr Dennis Project");
// Setup the number of columns and rows
lcd.begin(16, 2);
// Print to the screen
lcd.print("Mr. Dennis First LCD project");
delay(100);
}
void loop() {
// put your main code here, to run repeatedly:
// Move LCD screen to 13 position left
// Hence to move it. You loop through
for(int postnCounter = 0; postnCounter < 13; postnCounter++){
lcd.scrollDisplayLeft();
delay(50);
}
// Scroll 29 positions (string length + display length) to the right
// to move it offscreen right
for (int positionCounter = 0; positionCounter < 29;
positionCounter++) {
// Scroll one position right
lcd.scrollDisplayRight();
// Wait a bit
delay(150);
}
// Scroll 16 positions (display length + string length) to the left
// to move it back to center
for (int positionCounter = 0; positionCounter < 16;
positionCounter++) {
// Scroll one position left
lcd.scrollDisplayLeft();
// Wait a bit
delay(150);
}
// Delay at the end of the full loop
delay(1000);
}