pmiguelpinto90 / ShiftDisplay

Arduino library for driving 7-segment displays using shift registers
GNU General Public License v3.0
31 stars 15 forks source link

Scrolling text #12

Open ameer1234567890 opened 5 years ago

ameer1234567890 commented 5 years ago

This isn't a bug, but a question. How do I make long text shown on a four digit display by scrolling method, with this library?

becomen commented 4 years ago

void slide(String hello, boolean reset){ static int current = 1; if(reset){ current++; } for(int i = 0; i < NUM_DIGITS; i++){ hello = " " + hello; } if(current > 0){ for(int j = 0; j <= hello.length(); j++){ display.show(hello, 130); String first = hello.substring(0, 1); hello = hello.substring(1) + first; } current--; } }