Gast
#476312
Hallo,
gibt es eine einfache Funktion zur Textausgabe vom Mikrocontroller zum
Terminal über Usart.
Mein Versuch sieht so aus und klappt leider nicht:
void usart_putc(unsigned char c)
{
while (!(UCSRA & (1<<UDRE))); // warten bis Senden moeglich
UDR = c; // sende Zeichen
}
void usart_puts (unsigned char *s)
{
while (*s)
{
usart_putc(*s);
s++;
}
}
void Usart_Tx(char text)
{
char s[50];
usart_puts(text);
}
int main (void)
{
Usart_Tx('Hallo welt!');
return 0;
}
Gruß flo