Und wenn dir das zählen lästig wird, dann ist die PrintStr von @stochri recht nützlich.
Code:
/***************************************************************************
* void PrintStr(unsigned char *data)
* improved string printig function *
*
* This function avoids the counting input argument because it is so annoying
* counting characters manualy.
* Usualy c-text strings are terminated by 0x00.
*
* last modification:
* Ver. Date Author Comments
* ------- ---------- -------------- ---------------------------------
* sto2 30.07.2005 stochri text printing function
* ------- ---------- -------------- ---------------------------------
*
***************************************************************************/
void PrintStr(unsigned char *data)
{
unsigned char i = 0;
while(data[i++]!=0x00);
SerWrite(data,i);
}
void PrintInt(int wert)
{ char text[6]=" ";
itoa(wert,text,10);
SerWrite(text,5);
}
Lesezeichen