//This sketch will turn ‘ON’ the Piezo Buzzer once when the program start.
#define BUZZER_PIN 18 // ESP32 GIOP18 pin connected to Buzzer's pin
void setup() {
// put your setup code here, to run once:
pinMode(BUZZER_PIN, OUTPUT); // set ESP32 pin to output mode
}
void loop() {
analogWrite(BUZZER_PIN,250); //Turn the Buzzer ON
delay(500);
analogWrite(BUZZER_PIN,LOW); //Turn the BUZZER OFF
}