#define BLYNK_TEMPLATE_ID "TMPL6gZcyTUhD"
#define BLYNK_TEMPLATE_NAME "Kontrol LED"
#define BLYNK_AUTH_TOKEN "gwRyjqf3ij0FJJE2_--17EKC5if_joWa"
#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "Wokwi-GUEST";
char pass[] = "";
WidgetLED led1(V1);
BlynkTimer timer;
// V1 LED Widget is blinking
void blinkLedWidget()
{
if (led1.getValue()) {
led1.off();
Serial.println("LED on V1: off");
Blynk.virtualWrite(V1, LOW);
} else {
led1.on();
Serial.println("LED on V1: on");
Blynk.virtualWrite(V1, HIGH);
}
}
void setup()
{
Serial.begin(115200);
Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);
timer.setInterval(1000L, blinkLedWidget);
}
void loop()
{
Blynk.run();
timer.run();
}