#define BLYNK_TEMPLATE_ID "TMPL30DNJRJEp"
#define BLYNK_TEMPLATE_NAME "LED ON OFF"
#define BLYNK_AUTH_TOKEN "a9n53lNZtzL1JHovRxU89_FeVGPpYzSj"
// Comment this out to disable prints and save space
#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[] = "";
// This function will be called every time Slider Widget
// in Blynk app writes values to the Virtual Pin V1
BLYNK_WRITE(V0)
{
int pinValue = param.asInt();
if(param.asInt() == 0)
{
digitalWrite(27, HIGH);
}
else{
digitalWrite(27, LOW);
}// assigning incoming value from pin V1 to a variable
// process received value
}
void setup()
{
// Debug console
Serial.begin(115200);
pinMode(27, OUTPUT);
Blynk.begin(auth, ssid, pass);
// You can also specify server:
//Blynk.begin(auth, ssid, pass, "blynk.cloud", 80);
//Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);
}
void loop()
{
Blynk.run();
}