Serial Monitor is automatically typing enter and i cannot type in anything. Help

When want to save a number in a variable i cannot type something in the Serial monitor. I used this code:

  • Serial.print("How much coffee do you need?");*
  • while (Serial.available() == 0);*
  • int coffee= Serial.parseInt();*

The Monitor is typing enter automatically and the variable is empty. If i type a the number in under 1 sec it is works. But i cant type everything so fast. It works on my laptop but not on my other computers. [u]It doesnt matter what version i download, It is everytime the same problem.[/u]

Can somebody help me?

It's not clear to me what you mean by "The Monitor is typing enter automatically". Please provide more details.

Start with this code; adjust baudrate to needs.

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  Serial.print("How much coffee do you need?");
  while(Serial.available() == 0);
  Serial.println(Serial.read(), HEX);
}

If that prints A and/or D after the text and it all keeps repeating without you entering anything, you are right in your diagnosis.

Please note how code is posted (using code tags).

@oanhviela Did you try the code in reply #2? What happened?

Two people with the same problem. OK, which operating system? Which version of the IDE? Or are you using the web editor?