/*#include <Servo.h>
//SERVO
Servo servo;
int a = 0;
int b = 0;
void setup()
{
// put your setup code here, to run once:
servo.attach(3);
}
void loop()
{
// put your main code here, to run repeatedly:
for (int a = 0;a <= 180; a++)
{
servo.write(a);
delay(5);
}
for (int b = 180;b >=0; b --)
{
servo.write(b);
delay(5);
}
}*/
#include <Servo.h>
Servo myservo;
int val;
void setup()
{
myservo.attach(3);
//pinMode(A4,INPUT);
}
void loop()
{
val = analogRead(A4);
val = map(val, 0, 1023, 0, 180);
myservo.write(val);
delay(15);
}