#define BLYNK_TEMPLATE_ID "TMPL6uqelc227"
#define BLYNK_TEMPLATE_NAME "IOT Monitoring System 6"
#define BLYNK_AUTH_TOKEN "TSUpPQ77EhufThGYuCaMO-JSHyZYicc4"
#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "Wokwi-GUEST";
char pass[] = "";
int pinled = 26;
BLYNK_WRITE(V0){
int pin_value = param.asInt();
if(pin_value == 1){
digitalWrite(pinled, HIGH);
Serial.println("LED Menyala !");
Blynk.virtualWrite(V1, "ON");
}else{
digitalWrite(pinled, LOW);
Serial.println("LED Mati !");
Blynk.virtualWrite(V1, "OFF");
}
}
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pinMode(pinled, OUTPUT);
Blynk.begin(auth, ssid, pass);
}
void loop() {
// put your main code here, to run repeatedly:
delay(1000); // this speeds up the simulation
Blynk.run();
}