#define uno 2
#define dos 12
#define tre 26
#define qua 25
#define qui 0
void setup()
{
  pinMode(dos, INPUT);
  pinMode(uno, OUTPUT);
  pinMode(tre, OUTPUT);
  pinMode(qua, OUTPUT);
  ledcSetup(qui, 0, 10);
  ledcAttachPin(uno, qui);
  ledcWriteTone(qui, 2000);
}
void loop()
{
  if (digitalRead(dos) == LOW)
 {
   digitalWrite(tre,HIGH);
   digitalWrite(qua,LOW);
 }
 else
  {
    alert();
    delay(10);
    digitalWrite(tre,LOW);
    digitalWrite(qua,HIGH);
    ledcWriteTone(qui, 0);

   }
}
void alert()
{
  float sinVal;
  int toneVal;
  for (int x = 0; x < 360; x +=10)
  {
    sinVal = sin(x * (PI / 180));
    toneVal = 2000 + sinVal * 500;
    ledcWriteTone(qui, toneVal);
    delay(10);
  }
}
$abcdeabcde151015202530fghijfghij