#include <Servo.h>
Servo servo;
int(a) = 0;
int(b) = digitalRead(3);
int(n) = 0;
int(d) = digitalRead(9);
int(c) = 0;
void setup() {
digitalWrite(9,INPUT);
digitalWrite(3,INPUT);
servo.attach(5);
servo.write(0);
delay(1005);
}
void loop(){
int(b) = digitalRead(3);
if ((b==1 and a ==0) or (b==0 and a == 1)){
a = b;
if (b==1){
n += 10;
servo.write(n);
delay(250);
}
}
int(d) = digitalRead(9);
if ((d == 1 and c == 0) or (d == 0 and c == 1)){
c = d;
if (d==1){
n = n - 10;
servo.write(n);
delay(250);
}
}
}