Here is the code:
#include <Servo.h>
Servo myservo;
int switchpin = 13;
int val = 0;
void setup()
{
myservo.attach(9);
}
void loop()
{
val = digitalRead(switchpin);
if (val == HIGH){
myservo.write(70);
delay(2000);
}
else myservo.write(1);
}
This is the video: