#define BLYNK_PRINT Serial

/* Fill in information from Blynk Device Info here */


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

// Your WiFi credentials.
char ssid[] = "Wokwi-GUEST";
char pass[] = "";


void setup()
{
  // Debug console
  Serial.begin(9600);
  pinMode(2, OUTPUT);
  pinMode(4, OUTPUT);
  Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);
}

void loop() {
  Blynk.run();
  delay(1);
}

void v(int pin, int data) {
  if (data == 1) {
    digitalWrite(pin, true);
    return;
  }
  digitalWrite(pin, false);
  return;
}

BLYNK_WRITE(V1) {
  v(4, param.asInt());
}
BLYNK_WRITE(V0){
  v(2, param.asInt());
}


BLYNK_CONNECTED() {
  Blynk.syncVirtual(V1);
}