#include <LiquidCrystal.h>
// Инициализация библиотеки с настройками подключения LCD
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
lcd.begin(16, 2); // Установка размера дисплея
}
void loop() {
String message = "Ushakov is the coolest of all"; // Сообщение для отображения
int length = message.length();
// Бегущая строка
for (int pos = 0; pos < length + 16; pos++) {
lcd.clear(); // Очищаем экран
lcd.setCursor(0, 0); // Устанавливаем курсор в начало
// Отображаем часть сообщения
if (pos < length) {
lcd.print(message.substring(pos, pos + 16));
} else {
// Печатаем пробелы в начале, когда строка уходит за пределы
int spaces = pos - length;
lcd.print(" "); // 16 пробелов
lcd.setCursor(spaces, 0);
lcd.print(message.substring(0, 16 - spaces));
}
delay(300); // Задержка между кадрами
}
}