How to: Make text scroll

Hey Team,

I am starting to get my feet wet with the Arduboy.

As one of my first things that I was trying to implement was a text scroll, similar to the one that happens when you start the Arduboy.

However it doesn’t seem to clear the screen after it was displayed.
Here is what I have in the loop part:

for (int i = 0; i < 127; i++) {
        arduboy.setCursor(i, height/2);
        arduboy.print("PONG");
        
      }

You need to add clear, display and delay functions to your loop. You can also make it more efficient by using a byte for the index.

for (byte i = 0; i < 127; i++) {
  arduboy.clear();
  arduboy.setCursor(i, height/2);
  arduboy.print("PONG");
  arduboy.display();
  delay(100);
}
2 Likes

Thanks so much! This was super fast and super helpful!

1 Like