Code: Select all
void loop() {
buttonState = digitalRead(buttonInput);
if (buttonState == LOW) {
matrix.fillScreen(0);
matrix.setCursor(x, 0);
matrix.print(F("Howdy"));
if (--x < -36) {
x = matrix.width();
matrix.Color(255, 0, 0);
}
matrix.show();
delay(100);
}
else {
matrix.fillScreen(0);
matrix.setCursor(x, 0);
matrix.print(F("12345"));
if (--x < -36) {
x = matrix.width();
matrix.Color(0, 255, 0);
}
matrix.show();
delay(100);
}
}
Code: Select all
const uint16_t colors[] = { matrix.Color(255, 0, 0), matrix.Color(0, 255, 0), matrix.Color(0, 0, 255) };
void setup() {
matrix.begin();
matrix.setTextWrap(false);
matrix.setBrightness(5);
matrix.setTextColor(colors[0]);
}
int x = matrix.width();
int pass = 0;
void loop() {
matrix.fillScreen(0);
matrix.setCursor(x, 0);
matrix.print(F("Test"));
if(--x < -30
) {
x = matrix.width();
if(++pass >= 8) pass = 0;
matrix.setTextColor(colors[pass]);
}
matrix.show();
delay(30);
}