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