#include <Servo.h>
int BUTTON_PIN1 = 13;
Servo myservo; // create servo object to control a servo
// twelve servo objects can be created on most boards
int pos = 0; // variable to store the servo position
void setup() {
myservo.attach(9); // attaches the servo on pin 9 to the servo object
pinMode(BUTTON_PIN1, INPUT);
}
void loop() {
int i=1;
if (digitalRead(BUTTON_PIN1) == HIGH)
{
while (i == 1)
{
myservo.write(90);
delay(1.5);
myservo.write(0);
delay(19);
}
}
}