Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
Hi,
I am having some trouble with scanf. I have been testing with a small example (see below). When the program executes, the scanf function blocks and waits for my input. The input is then printed to the screen. In the next loop, the same should happen, but it seems the scanf function is directly left again (without blocking and waiting for input).
Anyone any idea what the reason could be?
uint32_t number;
int main() {
while(1) {
scanf("%d", &number);
printf("number = %d \r\n", number);
wait(1);
}
}