int BUZZER_PIN = 13;
int BUZZER_CHANNEL = 0;
int b1,b2,b3;
void setup() {
pinMode(5,INPUT_PULLUP);
ledcAttachPin(BUZZER_PIN, BUZZER_CHANNEL);
}
void loop() {
b1 = digitalRead(5);
if (b1== LOW)
{
ledcWriteNote(BUZZER_CHANNEL, (note_t)NOTE_D, 8);
delay(10);
}
else
{
ledcWrite(0, 0);
delay(10);
}
}