#define BLYNK_TEMPLATE_ID "TMPL6XffQdbEm"
#define BLYNK_TEMPLATE_NAME "Quickstart Device"
#define BLYNK_AUTH_TOKEN "k5cCx0otJriymvhZG1ut4oiFKaylueq1"
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "Wokwi-GUEST";
char pass[] = "";
#define LED_PIN 18 // Pin to which the LED is connected
BLYNK_WRITE(V0) { // This function gets called when the Button Widget in the app changes state
int ledState = param.asInt(); // Get the state of the button (0 or 1)
digitalWrite(LED_PIN, ledState); // Set the LED based on the button state
}
void setup() {
Serial.begin(115200);
Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);
pinMode(LED_PIN, OUTPUT);
}
void loop() {
Blynk.run();
}