/* * Rs232.h * * Created: 04.11.2013 21:31:09 * Author: netz */ #ifndef RS232_H_ #define RS232_H_ #include #include template class Uart { public: Uart() { sei(); init(); println("Uart done!"); } void print(const char *text) { while (*text) { uart_putchar(*text); text++; } } void printDec(uint16_t wert) { print((wert/10000)+'0'); print(((wert/1000)%10)+'0'); print(((wert/100)%10)+'0'); print(((wert/10)%10)+'0'); print((wert%10)+'0'); } void println(const char *text) { print(text); print("\r"); print("\n"); } void print(uint8_t wert) { uart_putchar(wert); } private: void init() { UBRR0L = (F_CPU / (baudrate * 16L) - 1); //Teiler wird gesetzt UCSR0A= (0<