code/arduino_c_serial/serial.c
/**
	This function initializes serial communication on the arduino
	We are only going to be recieving so we only set up RX
*/
This function initializes serial communication on the arduino
We are only going to be recieving so we only set up RX
This function initializes serial communication on the arduino We are only going to be recieving so we only set up RX
void uart_init(void){
	UBRR0H = UBRRH_VALUE;
	UBRR0L = UBRRL_VALUE;
	#if USE_2X
		UCSR0A |= _BV(U2X0);
	#else
		UCSR0A &= ~(_BV(U2X0));
	#endif
	UCSR0C = _BV(UCSZ01) | _BV(UCSZ00);
	UCSR0B =  _BV(RXEN0)| _BV(TXEN0);
}
void uart_init ( void ) { UBRR0H = UBRRH_VALUE ; UBRR0L = UBRRL_VALUE ; #if USE_2X UCSR0A |= _BV ( U2X0 ) ; #else UCSR0A &= ~ ( _BV ( U2X0 ) ) ; #endif UCSR0C = _BV ( UCSZ01 ) | _BV ( UCSZ00 ) ; UCSR0B = _BV ( RXEN0 ) | _BV ( TXEN0 ) ; }
This function initializes serial communication on the arduino
We are only going to be recieving so we only set up RX
This function initializes serial communication on the arduino We are only going to be recieving so we only set up RX
/*
		The following if/else determines whether the UART
		has to run in double speed mode
	*/ /*
		Setting the serial port to 8 bit mode
		and to recieve data 
	*/