#include <LiquidCrystal.h>
// Initialize the LCD with the pin numbers
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
// The string to scroll on the LCD
const char *message = "IOT PROJECT ECE!";
// Initial positions for scrolling
int position = 0;
int scrollDelay = 300; // Delay between scroll steps
void setup() {
// Initialize the LCD
lcd.begin(16, 2);
lcd.clear();
}
void loop() {
// Scroll text to the left
for (position = 0; position < strlen(message) + 16; position++) {
lcd.clear();
lcd.setCursor(16 - position, 0);
lcd.print(message);
delay(scrollDelay);
}
delay(1000); // Pause before scrolling right
// Scroll text to the right
for (position = strlen(message) + 16; position >= 0; position--) {
lcd.clear();
lcd.setCursor(16 - position, 0);
lcd.print(message);
delay(scrollDelay);
}
delay(1000); // Pause before scrolling again
}