This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Break condition in while loop

Following is my program. I am trying to read characters at different baud rate and if no character is received within 10 seconds I want to break out of the loop and similarly if any character other than alphabets is received, I again want to break out of the loop? How can I do that. Please guide me.

char read()
{ while(1) { delay_ms(10000); break;

if((uart_RxChar() >= 65 && uart_RxChar() <= 90) || (uart_RxChar() >= 97 && uart_RxChar() >= 122)) { uart_TxChar('k'); Glow_GreenLED(); } else { Glow_RedLED(); break; } }
}

Parents Reply Children