#include <Servo.h>
const int BTN_PIN = 3;
const int SERVO_PIN = 11;
Servo servo;
void setup() {
Serial.begin(115200);
pinMode(BTN_PIN, INPUT_PULLUP);
servo.attach(SERVO_PIN);
servo.write(90);
}
void loop() {
if (digitalRead(BTN_PIN) == LOW) {
for (int count = 0; count < 5; count++) {
servo.write(0);
delay (500);
servo.write(90);
delay(500);
}
}
}