#include <Servo.h>
Servo servo;
const int servoPin = 11;
const int potPin = A0;
void setup() {
servo.attach(servoPin);
pinMode(potPin, INPUT);
}
void loop() {
int potValue = analogRead(potPin);
int angle = map(potValue, 0, 1023, 0, 180);
servo.write(angle);
}