const int buttonPin = 11; int buttonState = 0; void setup() { pinMode(buttonPin, INPUT); servoMain.attach(10); } void loop(){ buttonState = digitalRead(buttonPin); if (buttonState == HIGH) { servoMain.write(135); delay(1000); servoMain.write(90); } else { servoMain.write(90); } }