#include <Servo.h>
Servo myServo;
int pos = 0;
int potPin = A0;
int potValue = 0;
int outputValue = 0;
void setup()
{
myServo.attach(9);
myServo.write(pos);
delay(10);
}
void loop() {
potValue = analogRead(potPin);
pos = map(potValue, 0, 1023, 0, 180);
myServo.write(pos);
delay(30);
}