Simple serial console problem

Hey,

Here is another stupid question.
I want to control position of servo motor via serial console. When I am putting any integer, results is always come 0.

Here is my code.

#include <Servo.h>

Servo servo1;  
long num;     

void setup()
{
 servo1.attach(9);
Serial.begin(9600); 
Serial.print("Enter Position = ");
}

void loop() 
{ 
  while(Serial.available()>0)
  { 
  num= Serial.parseInt();   
  Serial.print(num);  
  Serial.println(" degree");
  Serial.print("Enter Position = ");
  }
  servo1.write(num);
  delay(15);
}

You need to select "No line ending" from the dropdown menu near the bottom right corner of Serial Monitor.

pert:
You need to select "No line ending" from the dropdown menu near the bottom right corner of Serial Monitor.

Thanks.

(Close this thread).