#define BLYNK_TEMPLATE_ID "TMPL6lOrS4jq9"
#define BLYNK_TEMPLATE_NAME "RemoteButtonLed"
#define BLYNK_AUTH_TOKEN "yjzJ6Br5UIAkPFCpXHPlrRJpO7bwBcPs"

#define BLYNK_PRINT Serial
#define AUTO 1
#define MANUAL 0

//1)Include related library
#include <LCD_I2C.h>  //library by blackhack Version bump to 2.3.0
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#include <TimeLib.h>  //Library by PaulStoffregen
#include <WidgetRTC.h>

//2)Define constant
char ssid[] = "Wokwi-GUEST";
char pass[] = "";

//3) Mapping Object
LCD_I2C lcd(0x27, 16, 2);
BlynkTimer timer;
WidgetRTC rtc;

//4) Declare Global Var
int virtual_pin_v0 = 0, virtual_pin_v1 = 0;

//5) User-define Function
BLYNK_WRITE(V0) {
  virtual_pin_v0 = param.asInt();  // assigning incoming value from pin V1 to a variable

  // process received value
  Serial.print("Button V0:");
  Serial.println(virtual_pin_v0);
  if (virtual_pin_v0) t_v0 = millis() + (1000 * 10);
  else Serial.println("Wrong Format!!");
}

BLYNK_WRITE(V1) {
  virtual_pin_v1 = param.asInt();  // assigning incoming value from pin V1 to a variable

  // process received value
  Serial.print("Button V1:");
  Serial.println(virtual_pin_v1);
  if (virtual_pin_v1) t_v1 = millis() + (1000 * 10);
  else Serial.println("Wrong Format!!");
}

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  Serial.println("Hello, ESP32!");
}

void loop() {
  // put your main code here, to run repeatedly:
  delay(10); // this speeds up the simulation
}