#define BLYNK_TEMPLATE_ID "TMPL-j1Zuy7O"
#define BLYNK_DEVICE_NAME "ESP32 Kontrol LED"
#define BLYNK_AUTH_TOKEN "147o2t44KSmCmN9xruDISlDVQzHGZWBu"

#define BLYNK_PRINT Serial

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


char auth[] = BLYNK_AUTH_TOKEN;


char ssid[] = "Wokwi-GUEST"; //nama hotspot yang digunakan
char pass[] = ""; //password hotspot yang digunakan

BLYNK_WRITE(V0)
{
  int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
  if (pinValue == 1)
  {
    digitalWrite(4, HIGH);
  }
  else {
    digitalWrite(4, LOW);
  }
  // process received value
}

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

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