#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
unsigned long cur = 0;
unsigned long pretime = 0;
int time = 150;
int state = LOW;
int x = 0;
void setup() {
Serial.begin(115200);
lcd.init();
lcd.backlight();
}
void loop() {
showlcd();
/* for(int col = 15; col >= 0; col--){
lcd.setCursor(col, 0);
lcd.print("Hello");
delay(200);
lcd.clear();
}*/
}///end loop
void showlcd(){
cur = millis();
if (cur - pretime >= time) {
pretime = cur;
if (state == LOW) {
lcd.setCursor(x, 0);
lcd.print("Hello");
state = HIGH;
} else {
state = LOW;
lcd.clear();
x++;
}
if (x >= 16) {
x = 0;
}
}
}