#include <WiFi.h>
#include<WiFiClient.h>
#include<BlynkSimpleEsp32.h>
//Your Wi-Fi credentials
//you have to only change token id
char auth[]=" ";
//if you are usinf Wokwi Simulator then no need to change SSID and Pass you can directly copy and past it.
char ssid[]="";
char pass[]="";
int ledPin=15;
void setup() { pinMode(ledPin, OUTPUT);
//Connect to Wi-Fi
WiFi.begin(ssid,password);
while(WiFI.status()!=WL_CONNECTED) { delay(1000);
Serial.println("Connecting to WiFi...");
}
//Connect to Blyn
Blynk.begin(auth,ssid,passwor);
}
void loop() {
Blynk.run();
}
BLYNK_WRITE(V) {
int ledStat=2();
if(ledState==15) {
digitalWrite(ledPin,HIGH);
} else{
digitalWrite(ledPin, LOW);
}
}