#include<Servo.h>
Servo a;
Servo b;
int pin1=8;
int pin2=3;
int j1= A0;
int j2=A1;
void setup() {
a.attach(pin1);
b.attach(pin2);
}
void loop() {
int x= analogRead(j1);
int y= analogRead(j2);
if(x <= 300)
{
a.write(180);
}
else if(x>=700)
{
a.write(0);
}
else if(y <= 300)
{
b.write(180);
}
else if(y>=700)
{
b.write(0);
}
else
{
a.write(90);
b.write(90);
}
}