I am trying to get a message to scroll across an LED matrix with out using delay. I have figured out how to get the message to scroll across the screen, but the message is zipping by so fast that you can not read it. I am pretty sure the problem is with my if loop and the way that I am trying to use millis() as a delay.
void loop()
{
unsigned long lastScrollTime = millis();
if (lastScrollTime - millis() <= 5000)
{
matrix.setTextSize(1);
matrix.setTextWrap(false);
matrix.setTextColor(LED_ON);
matrix.setRotation(1);
do{
matrix.clear();
matrix.setCursor(x,0);
matrix.print("World");
matrix.writeDisplay();
x--;
}while(x >= -36);
x=7;
lastScrollTime = millis();
}
}