#include <Servo.h>
#define led 12
#define buzzer 4
Servo myservo;

void setup() {
  // put your setup code here, to run once:
pinMode(led, OUTPUT);
pinMode(buzzer, OUTPUT);
myservo.attach(3);
}

void loop() {
  // put your main code here, to run repeatedly:
digitalWrite(led, HIGH);
noTone(buzzer);
delay(2000);
myservo.write(180);
digitalWrite(led, LOW);
tone(buzzer, 1000);
delay(2000);
}