Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void glcdScrollMsg(uint8_t posX, char *msg)
- {
- #define DISPLAY_WIDTH 26
- static int8_t x = DISPLAY_WIDTH;
- uint8_t col = 0;
- if (x-- <= (int8_t)strlen(msg)*-1)x = 26;
- glcdGotoXY(posX,spalte=0);
- if (x>=0)
- {
- while((col++ < x) && (col < (DISPLAY_WIDTH)))
- {
- glcdPutc(' ',posX,spalte++);
- }
- while ((*msg) && (col++ < (DISPLAY_WIDTH)))
- {
- glcdPutc(*msg++,posX,spalte++);
- }
- while (col++ < (DISPLAY_WIDTH))
- {
- glcdPutc(' ',posX,spalte++);
- }
- }
- else
- {
- if ((x+strlen(msg)) <= 0)
- {
- while (col++ < (DISPLAY_WIDTH))
- {
- glcdPutc(' ',posX,spalte++);
- }
- }
- else
- {
- uint8_t i = abs(x);
- while ((msg[i]) && (col++ < (DISPLAY_WIDTH)))
- {
- glcdPutc(msg[i++],posX,spalte++);
- }
- while (col++ < (DISPLAY_WIDTH))
- {
- glcdPutc(' ',posX,spalte++);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement