#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#define i2caddr 0x27
LiquidCrystal_I2C lcd(i2caddr, 16, 2);
int col = 0;
int row = 0;
bool back = false;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
lcd.init();
lcd.clear();
lcd.backlight();
}
void loop() {
String message = "HOLIS!";
String messagef = "FIJO!";
int msglen = message.length();
lcd.clear();
if (col < 16 - msglen && !back) col++;
else if(col >= 16- msglen) back = true;
if (col > 0 && back) col--;
else if (col <= 0) back = false;
lcd.setCursor(col,0);
lcd.print(message);
lcd.setCursor(0,1);
lcd.print(messagef);
delay(100); // this speeds up the simulation
}