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