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