uint8_t uart_init(uint32_t baudrate, uint16_t format) { /* function sets up the UART interface */ /* parmeter: baud rate gives the operation speed of the interface format gives the data format in a int value hundrets: number of data bits tens: paraity (0 - no, 1 - odd, 2 - even) ones: number of stop bits (1 or 2) */ UBRRH = (F_CPU/(16 * baudrate) - 1) >> 8; UBRRL = F_CPU/(16 * baudrate) - 1; UCSRB |= (1<