SHARE
TWEET

ScrollText

a guest Oct 18th, 2019 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void ScrollText () {    
  2.   for (int offset = 0; offset < Text.length(); offset++) {
  3.    String t = "";
  4.   for (int i = 0; i < 8; i++)                             // 8 = width of the text string in characters on display
  5.     t += Text.charAt((offset + i) % Text.length());
  6.     tft1.setTextWrap(false);
  7.     tft1.setRotation(3);
  8.     tft1.setFont(&FreeSerif9pt7b);
  9.     tft1.setTextSize(1);
  10.     tft1.fillRect(3, 3, 75, 20,BackFill);
  11.     tft1.setTextColor(WHITE);
  12.     tft1.setCursor(3, 20);
  13.     tft1.print(t);
  14.  }
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top