Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2014
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1.     const char *srcString = "Microcontrollers are lots of fun!";
  2.     size_t strLen = strlen(srcString);
  3.     size_t buffSize = LCD_WIDTH + strLen;
  4.     char* screenBuffer = malloc(buffSize);
  5.     memset(screenBuffer, ' ', LCD_WIDTH - 1);
  6.     memcpy(&(screenBuffer[LCD_WIDTH - 1]), srcString, strLen + 1);
  7.  
  8.     size_t i = 0;
  9.     while (true) {
  10.         lprintf("%.*s\n", LCD_WIDTH, &(screenBuffer[i %= buffSize]));
  11.         //wait_ms(300);
  12.         i++;
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement