#define BLYNK_TEMPLATE_ID "TMPL33ezmrqr1"
#define BLYNK_TEMPLATE_NAME "Home Automation test"
#define BLYNK_AUTH_TOKEN "z2pUcsWq-4CRV_MBHk6b2S5A68FHMjzV"
#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
char auth[] = BLYNK_AUTH_TOKEN;
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "Wokwi-GUEST";
char pass[] = "";
BLYNK_WRITE(V0)
{
int pinValue = param.asInt();
if (pinValue == 1)
{
digitalWrite(4, HIGH);
}
else {
digitalWrite(4, LOW);
}
}
void setup()
{
// Debug console
Serial.begin(115200);
pinMode(4, OUTPUT);
Blynk.begin(auth, ssid, pass);
}
void loop()
{
Blynk.run();
}