#define BLYNK_TEMPLATE_ID "TMPL6v9VPrkMa"
#define BLYNK_TEMPLATE_NAME "prj1"
#define BLYNK_AUTH_TOKEN "klexA7JMtrpmy2M5s5Vl9Ms-hLGra2v5"

#define BLYNK_PRINT Serial

#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>

char ssid[] = "Wokwi-GUEST";
char pass[] = "";


int state =LOW;
int value;

BLYNK_WRITE(V2)
{
  
  int value = param.asInt();
  
  //Blynk.virtualWrite(V1, value);
}

void setup()
{
  pinMode(2, OUTPUT);
  pinMode(19, INPUT_PULLUP);
  Serial.begin(115200);

  Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);
  
  
}

void loop()
{
  Blynk.run();

  int val = digitalRead(19);
delay(50);
if(val==0){
  state = !state;


}
//digitalWrite(2,state);
//Blynk.virtualWrite(V0, state);
//delay(1000);
//if (value==1){
  //digitalWrite(2, HIGH);
//}else{
//digitalWrite(2, LOW);
digitalWrite(2,value);

}//end loop