#include <Servo.h>
Servo servo;
int value;
void setup() {
servo.attach(5);
// put your setup code here, to run once:
}
void loop() {
int a;
// put your main code here, to run repeatedly:
value = analogRead(A0);
a=map(value,0,1023,0,179);
servo.write(a);
delay(10);
a=map(value,1023,0,179,0);
servo.write(a);
delay(10);
}