#include <LiquidCrystal.h>
// Define the pins used for the LCD
LiquidCrystal lcd(12, 11, 10, 9, 8, 7);
void setup() {
// Initialize the LCD with 16 columns and 2 rows
lcd.begin(16, 2);
lcd.print("Scrolling Text");
}
void loop() {
// Display scrolling text
scrollText("Hello from Pi Pico! ", 500);
}
void scrollText(String message, int delayTime) {
for (int position = 0; position < message.length(); position++) {
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(message.substring(position));
delay(delayTime);
}
}