#include <Servo.h>
Servo gate;
int button = PA1;
void setup() {
pinMode(button, INPUT_PULLUP);
gate.attach(D5);
gate.write(0);
}
void loop() {
if(digitalRead(button) == LOW){
delay(200);
gate.write(90);
delay(3000);
gate.write(0);
}
}