"This is a string. " Rotate to : "his is a string. T" Rotate to : "is is a string. Th" .... I use it for LCD Display for Scroll.
I use it for LCD Display for Scroll. The easy, effective way to scroll is to add dispaly length of the message at the end of the message. Then all you need is to bump the start. Erik
Off the top of my head:
char* strrol (char* src) { char* d = src; char* s = d + 1; char c = *d; while (*s++) { *d++ = *s; } *d++ = c; *d = 0; } // strrol
void send (char* s, int offset) { int l = strlen(s); int i; for (i = offset; i < l; ++i) { OutputToLcd (s[i]); } for (i = 0; i < offset; ++i) { OutputToLcd (s[i]); } }
Hello.
void LCD_print_with_rotate(char *aStr) { unsigned char i, j, k; j=strlen(aStr); for (i=0; i<j; i++) { lPtr=&aStr[i]; LCD_clear_screen(); for (k=0; k<j; k++) { LCD_putchar(*lPtr++); if (!*lPtr) lPtr=aStr; } } }
..add
{char *lPtr;}