#include <Servo.h>
Servo myServo;
int button1 = 2;
void setup() {
// put your setup code here, to run once:
myServo.attach(4);
pinMode(button1, INPUT_PULLUP);
digitalWrite(button1, HIGH);
}
void loop() {
// put your main code here, to run repeatedly:
if (digitalRead(button1) == LOW) {
myServo.write(70);
delay(250);
} else {
myServo.write(0);
delay(250);
}
}