/* Used LEDDisplay library at https://www.pjrc.com/teensy/td_libs_LedDisplay.html */
#include <LedDisplay.h>
// Define pins for the LED display.
// You can change these, just re-wire your board:
#define dataPin 6 // connects to the display's data in
#define registerSelect 7 // the display's register select pin
#define clockPin 8 // the display's clock pin
#define enable 9 // the display's chip enable pin
#define reset 10 // the display's reset pin
#define displayLength 4 // number of characters in the display
String msg = " HCMS-2902 DEMO ";
unsigned long previousMillis = 0; // will store last time LED was updated
const long interval = 300;
int i = 0;
int brightness = 10; // screen brightness
LedDisplay myDisplay = LedDisplay(dataPin, registerSelect, clockPin, enable, reset, displayLength);
void setup() {
Serial.begin(9600);
// initialize the display library:
myDisplay.begin();
// set the brightness of the display:
myDisplay.setBrightness(brightness);
}
void loop() {
unsigned long currentMillis = millis();
if (currentMillis - previousMillis >= interval) {
previousMillis = currentMillis;
if (i < msg.length()) {
i = i + 1;
} else {
i = 0;
}
}
myDisplay.home();
myDisplay.print(msg.substring(i));
}