#define BLYNK_PRINT Serial
#define BLYNK_TEMPLATE_ID "TMPLm37tV0DN"
#define BLYNK_TEMPLATE_NAME "IoT Buzzer"
#define BLYNK_AUTH_TOKEN "5GtEVql-v-A5INGvcmHM7TP1C1XVa3fy"
#define Buzzerwokwi 27
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
BlynkTimer timer;
char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "Wokwi-GUEST";
char pass[] = "";
int buzz0=0;
BLYNK_WRITE(V0)
{ buzz0=param.asInt();
if (buzz0==1)
{
digitalWrite(Buzzerwokwi, HIGH);
tone(27, 1000, 500);
}
else{
digitalWrite(Buzzerwokwi, LOW);
}
}
void setup()
{
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
pinMode(Buzzerwokwi,OUTPUT);
}
void loop()
{
Blynk.run();
timer.run();
}