#include #define UART_BAUD_SELECT(b) (F_CPU/(b*16L)-1) void uart_init(unsigned int baud) { UBRRH=UART_BAUD_SELECT(baud)>>8; UBRRL=UART_BAUD_SELECT(baud)&0xFF; UCSRB=_BV(RXEN)|_BV(TXEN)|_BV(RXCIE)|_BV(TXCIE); UCSRC=_BV(URSEL)|_BV(UCSZ1)|_BV(UCSZ0); } void uart_tx_char(unsigned char ch) { // Wait if a byte is being transmitted while((UCSRA&(1<