Guys,
How can read received character from RX buffer ?
I try this :
LCD_CLEAR; LCD_FIRST_ROW; usart_pstr("AT\r\n"); lcd_string("Send AT DONE!"); char_receive = usart_receive_str(); if (char_receive != "") { LCD_CLEAR; lcd_string(char_receive); lcd_string("Rx Something"); } _delay_ms(1000); unsigned char usart_receive( void ) { /* Wait for data to be received */ while ( !(UCSR0A & (1<<RXC)) ) ; /* Get and return received data from buffer */ return UDR0; } usart_receive_str() { char line[50]; int i = 0; while(1) { line[i] = usart_receive(); if (line[i] == '\n') break; i++; } line[i] = 0; }
I'm waiting for "OK"
Any clues ?
thanks