For my first Arduino experience I made some minor changes to the LiquidCrystal -> HelloWorld example so the 2 lines of text would scroll in opposite directions. Ran it on an Adafruit Feather 32u4 Adalogger connected to a 16×2 LCD.
Exciting right? 😉
#include <LiquidCrystal.h>
LiquidCrystal lcd(5, 6, 9, 20, 19, 18);
void setup() {
lcd.begin(16, 2);
lcd.print("Hello");
lcd.setCursor(10, 1);
lcd.print("World!");
}
int i = 1;
int j = 9;
void loop() {
lcd.setCursor(i, 0);
lcd.print("Hello");
lcd.setCursor(j, 1);
lcd.print("World!");
i++;
if (i > 10) {
i = 0;
}
j--;
if (j < 0) {
j = 10;
}
delay(1000);
}