#include <Servo.h>
Servo myservo;//Assigning a servo variable
int x;
void setup() {
// put your setup code here, to run once:
myservo.attach(11);
}
void loop() {
// put your main code here, to run repeatedly:
x=analogRead(A1);
x=map(x,1023,0,180,0);
myservo.write(x);
delay(20);
}