#include <Servo.h>
// declaration with object 'myservo' was also a var;
Servo servMotor;
// declaration
int potPin = A0;
int potValue;
int angle;
void setup() {
servMotor.attach(9);
}
void loop() {
potValue = analogRead(potPin);
angle = map(potValue, 0, 1023, 0, 180);
servMotor.write(angle);
delay(15);
}