#include <Servo.h>
//This initializes the objects/ pins for the 2 servos controlling the top
Servo servo_t1;
Servo servo_t2;
const int top[2] = {3,9};
void setup() {
Serial.begin(115200);
}
void loop() {
//This "starts" the servos with their correpsonding pin
servo_t1.attach(top[0]);
servo_t2.attach(top[1]);
//Close
servo_t1.write(90);
servo_t2.write(90);
delay(2000); //Wait 2 second
//Open
servo_t1.write(135);
servo_t2.write(45);
delay(1000); //Wait 1 second
//This disconnects the servo to save power
servo_t1.detach();
servo_t2.detach();
delay(5000); //Wait 5 seconds
}