#include <Servo.h>
int potpin = A0;
int motorpin = 11;
Servo motor;
void setup(){
pinMode(potpin, INPUT);
motor.attach(motorpin);
}
void loop(){
int potvalue = analogRead(potpin);
int mapvalue = map(potvalue, 0, 1023, 0, 179);
motor.write(mapvalue);
}