serial.available()==0, doesn't wait for input

Serial.println("How many times do you want the Red LED to Blink?"); //ask for # red blinks
while (Serial.available()==0){ } //wait for input
numRedBlinks=Serial.parseInt(); //input number of red blinks

Serial.println("How many times do you want the Yellow LED to Blink?"); //ask for # yellow blinks
while (Serial.available()==0){ } // wait for input
numYellowBlinks=Serial.parseInt(); //input number of red blinks

This code waits for the first while statement (red) but doesn't wait for input for the second (yellow). I copied and pasted on Arduino 1.8.5 software and it runs perfectly.

Hi @tsiegel,

Could you please share a full sketch that reproduces the issue. Plus, also let us know what board and OS you are using on the PC. Thanks.

A very useful topic on this subject

Try while(!Serial.available());