#define BLYNK_TEMPLATE_ID "TMPL3mLnqRjpf"
#define BLYNK_TEMPLATE_NAME "home automation template"
#define BLYNK_AUTH_TOKEN "UlC_vlUU8g6LZull7spxxH4kXFF_AnL3"
#define BLYNK_PRINT Serial
#include<WiFi.h>
#include<WiFiClient.h>
#include<BlynkSimpleEsp32.h>
const char* ssid = "Wokwi-GUEST";
const char* pass = "";
BLYNK_WRITE(V0)
{
int valuev0=param.asInt();
if(valuev0==1)
{
digitalWrite(2,HIGH);
}
else{
digitalWrite(2,LOW);
}
}
BLYNK_WRITE(V1)
{
int valuev1=param.asInt();
if(valuev1==1)
{
digitalWrite(4,HIGH);
}
else
{
digitalWrite(4, LOW);
}
}
BLYNK_WRITE(V2)
{
int valuev2 = param.asInt();
if(valuev2 == 1)
{
digitalWrite(5, HIGH);
}
else
{
digitalWrite(5, LOW);
}
}
void setup()
{
Serial.begin(115200);
pinMode(2,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
Blynk.begin(BLYNK_AUTH_TOKEN, ssid,pass);
}
void loop()
{
Blynk.run();
}