Skip to content

Instantly share code, notes, and snippets.

@robinmanuelthiel
Created August 17, 2016 16:16
Show Gist options
  • Save robinmanuelthiel/a2f4913fb536510d799dfde473455cbb to your computer and use it in GitHub Desktop.
Save robinmanuelthiel/a2f4913fb536510d799dfde473455cbb to your computer and use it in GitHub Desktop.
A simple Arduino Sketch to let a marquee run through a LED panel.
// Use LiquidCrystal library to communicate with LCD
#include <LiquidCrystal.h>
// Select the pins used on the LCD panel
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
// Define message to show
String message = "My future tweets will be in this format";
void setup() {
// Set up the LCD's number of columns and rows
lcd.begin(16, 2);
// Print the message to the LCD
lcd.print(message);
// Wait a second
delay(1000);
}
void loop() {
// Scroll string length positions to the left to move it offscreen left
for (int positionCounter = 0; positionCounter < message.length(); positionCounter++) {
// Scroll one position left
lcd.scrollDisplayLeft();
// Wait a bit:
delay(200);
}
// Reset curser after completely scrolled to the left
lcd.setCursor(0, 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment