#include <Servo.h> 

Servo myservo;  // create servo object to control a servo 

const int buttonPin1 = 1;     // the number of the pushbutton pin
const int buttonPin2 = 2;     // the number of the pushbutton pin
const int buttonPin3 = 3;     // the number of the pushbutton pin
const int buttonPin4 = 4;     // the number of the pushbutton pin
const int buttonPin5 = 5;     // the number of the pushbutton pin
const int buttonPin6 = 6;     // the number of the pushbutton pin
const int outputPin1 = 7; // servo signal
const int outputPin2 = 8; // servo signal
const int outputPin3 = 9; // servo signal
const int outputPin4 = 10; // servo signal
const int outputPin5 = 11; // servo signal
const int outputPin6 = 12; // servo signal

int pos = 90;    // variable to store the servo position 
int oldButtonState;

void setup() 
{ 
 // Serial.begin(9600); // for sending data to serial monitor
 myservo.attach(outputPin1);  // attaches the servo on pin 9 to the servo object 
 myservo.attach(outputPin2);  // attaches the servo on pin 9 to the servo object 
 myservo.attach(outputPin3);  // attaches the servo on pin 9 to the servo object 
 myservo.attach(outputPin4);  // attaches the servo on pin 9 to the servo object 
 myservo.attach(outputPin5);  // attaches the servo on pin 9 to the servo object 
 myservo.attach(outputPin6);  // attaches the servo on pin 9 to the servo object 
 pinMode1(buttonPin1, INPUT_PULLUP); // initialize the pushbutton pin as an input:
 pinMode2(buttonPin2, INPUT_PULLUP); // initialize the pushbutton pin as an input:
 pinMode3(buttonPin3, INPUT_PULLUP); // initialize the pushbutton pin as an input:
 pinMode4(buttonPin4, INPUT_PULLUP); // initialize the pushbutton pin as an input:
 pinMode5(buttonPin5, INPUT_PULLUP); // initialize the pushbutton pin as an input:
 pinMode6(buttonPin6, INPUT_PULLUP); // initialize the pushbutton pin as an input:
} 

void loop() 
{ 
 // read the state of the pushbutton value:
 int buttonState = digitalRead(buttonPin1);
 int buttonState = digitalRead(buttonPin2);
 int buttonState = digitalRead(buttonPin3);
 int buttonState = digitalRead(buttonPin4);
 int buttonState = digitalRead(buttonPin5);
 int buttonState = digitalRead(buttonPin6);
 if (buttonState == LOW) 
 {  
   if (oldButtonState == HIGH)
   {
     myservo.write(pos);         // set the servo position
     digitalWrite(ledPin, pos=180? HIGH:LOW);
     delay(50);
     pos = (180-pos);  
   }
 }
 oldButtonState = buttonState;
}