/** Functions for serial port **/ #include #include #include "serial.h" static int send_serial_printf(char c,FILE *stream); static FILE mystdout=FDEV_SETUP_STREAM(send_serial_printf,NULL,_FDEV_SETUP_WRITE); void init_serial(int speed){ /* Set baud rate */ UBRR0 = F_CPU/(((unsigned long int)speed)<<4)-1; /* Enable transmitter & receiver */ UCSR0B = (1<