#include <Servo.h>
bool servo = false;
Servo myservo; 
int pos = 0;
void setup() {
Serial.begin(9600);
myservo.attach(9);
for(int i =3 ; i<6 ; i++){
pinMode(i , INPUT_PULLUP);
pinMode(7 , OUTPUT);
digitalWrite(i , HIGH);
}
}

void loop() {
  for(int j =3 ; j<6 ; j++){
if(digitalRead(j) == LOW){
    digitalWrite(7 , HIGH);
  myservo.write(90);
  delay(1000);
  myservo.write(0);
    digitalWrite(7 , LOW);              
}
}
}