I'm trying to get UART-communication to work, and I used some example-code from ATMEL as a base for this (UART Example). The main change I want to make is that instead of using test_string
I want to receive a string/char array using uart_getchar()
and run a character check, I.E:
data[i] = uart_getchar();
//repeat
switch (data[0]) {
case: 'w':
//do stuff 1
break;
case: 'r':
//do stuff 2
break;
}
But I'm having difficulties properly understanding the UART example, and getting my new code to work.
Any tips?