- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want to ask the user for several specifications, all just one char inputs; however, the program doesn't wait for the user input and goes along with outputting strings.
UART_PutString("Welcome");
UART_PutSring("Please Enter either A or B");
char1 = UART_GetChar();
UART_PutString("Please Enter either Z or Y");
char2 = UART_GetChar();
These are polling for user input once, so it is outside the for(;;). I am using Tera Term and it is connected with a serial of 115200 with 8 data bits. How do I make the program wait till the user inputs data?
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Welcome in the forum.
Use the UART_GetRxBufferSize() API. It will return != 0 when at least one character is in the buffer.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Bob. Moreover, my colleague and I wanted to give you an extra thanks for doing all you've done in this community, because we've had plenty of questions throughout the semester and you've been able to point us in the right direction numerous times. Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are always welcome!
Bob