#define BLYNK_PRINT Serial
#define BLYNK_TEMPLATE_ID "TMPLlzroXy0v"
#define BLYNK_TEMPLATE_NAME "Buzzer IoT"
#define BLYNK_AUTH_TOKEN "-6NCbcVTk3RB4kjNcV0dDMoiuNDEMMK7"
#define Buzzer 14
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>

BlynkTimer timer;
char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "Wokwi-GUEST";
char pass[] = "";
int buzzerPin = 0;

BLYNK_WRITE(V0)
{ buzzerPin=param.asInt();
if (buzzerPin==1)
{ tone(Buzzer,262);
}else{
noTone(Buzzer);
}
}

void setup()
{
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
pinMode(Buzzer,OUTPUT);
delay (1000);

}

void loop()
{
Blynk.run();
timer.run();
}