#define BLYNK_TEMPLATE_ID "TMPL6t9TWAvLV"
#define BLYNK_TEMPLATE_NAME "ledconnection"
#define BLYNK_AUTH_TOKEN "CVnE6FiPCD1Gg8HzlXUnUH4pcCgRHalB"
#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(V1)
{
int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
if (pinValue==1) {
digitalWrite(15, HIGH);
} else {
digitalWrite (15, LOW);
}
// process received value
}
void setup()
{
pinMode(15, OUTPUT);
// Debug console
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
// You can also specify server:
//Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass, "blynk.cloud", 80);
//Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass, IPAddress(192,168,1,100), 8080);
}
void loop()
{
Blynk.run();
}