#define BLYNK_TEMPLATE_ID "TMPL6C-JJ8VBL"
#define BLYNK_TEMPLATE_NAME "Control 2 lampu ke 2"
#define BLYNK_AUTH_TOKEN "b5y6IRH0XefWrDUEcuOCbTbm4PHCfJ1p"
#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "Wokwi-GUEST";
char pass[] = "";
const int pinLed1 = 19;
const int pinLed2 = 18;
int pinValue = 0;
BLYNK_WRITE(V0)
{
int pinValue = param.asInt();
if (pinValue == 1)
{
digitalWrite(pinLed1, HIGH);
}
else {
digitalWrite(pinLed1, LOW);
}
}
BLYNK_WRITE(V1)
{
int pinValue = param.asInt();
if (pinValue == 1)
{
digitalWrite(pinLed2, HIGH);
}
else {
digitalWrite(pinLed2, LOW);
}
}
void setup ()
{
Serial.begin(115200);
pinMode(pinLed1, OUTPUT);
pinMode(pinLed2, OUTPUT);
Blynk.begin(auth, ssid, pass);
}
void loop()
{
Blynk.run();
}