#include <LiquidCrystal.h>
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);
String text = "Abmiveh reza";
int len = text.length();
int pos = 0;
int dir = 1;
void setup() {
lcd.begin(16, 2);
}
void loop() {
lcd.clear();
lcd.setCursor(pos, 0);
lcd.print(text);
delay(1000);
pos += dir;
if (pos <= -len || pos >= 16) {
dir = -dir;
}
}