/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
#define BLYNK_TEMPLATE_ID "TMPL3HwyVyA-C"
#define BLYNK_TEMPLATE_NAME "Quickstart Template"
#define BLYNK_AUTH_TOKEN "0iS3Zt2ga7piJIAmGln4JETlPvz0bjM5"
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#define relay 14 // Relay pin
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "0iS3Zt2ga7piJIAmGln4JETlPvz0bjM5";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "Wokwi-GUEST";
char pass[] = "";
BLYNK_WRITE(V1)
{
int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
digitalWrite(relay,pinValue);
// process received value
}
void setup()
{
// Debug console
Serial.begin(9600);
pinMode(relay,OUTPUT);
Blynk.begin(auth, ssid, pass);
}
void loop()
{
Blynk.run();
}