void LCDWriteString(UINT8 line, UINT8 *str) { UINT8 len; UINT8 x; if (line == 2) LCDSecondLine(); else LCDFirstLine(); len = (UINT8)strlen(str); /* Check boundries */ if (len > MAX_LCD_CHARS) len = MAX_LCD_CHARS; for (x = 0; x < len; x++) { LCDWriteChar(str[x]); } /* Clear the rest of the line */ for (; x < 16; x++) { LCDWriteChar(' '); } }
void ShowVelocity(void){ unsigned char centena, dezena, unidade; float kmh; //velocityx é a velocidade atual. kmh = velocityx * 3.6; centena = kmh / 100; dezena = (kmh - (centena * 100)) / 10; unidade = kmh - (centena * 100) - (dezena * 10); LCDWriteChar(centena | 0x30,2,30); LCDWriteChar(dezena | 0x30,2,36); LCDWriteChar(unidade | 0x30,2,42); LCDWriteText("km/h",2,48); }
void LCDWriteString(char *text) { char c; while ( (c = *text++) ) LCDWriteChar(c); }
void LCDWriteString(char *string) { while (*string) LCDWriteChar(*string++); }