#define BLYNK_TEMPLATE_ID "TMPL6OqRBpSxL"
#define BLYNK_TEMPLATE_NAME "Control Lampu Antarmuka"
#define BLYNK_AUTH_TOKEN "Enf2FSK2UdecwboEsaqJvxeN0y3Yp68d"
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
uint8_t LED = 4;
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "Wokwi-GUEST";
char pass[] = "";
// This function will be called every time Slider Widget
// in Blynk app writes values to the Virtual Pin V1
BLYNK_WRITE(V0)
{
int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
if (pinValue == 1){
digitalWrite(LED, HIGH);
}
else{
digitalWrite(LED, LOW);
}
// process received value
}
void setup()
{
// Debug console
Serial.begin(115200);
pinMode(LED, OUTPUT); // Initialize the LED pin as an output
Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);
// You can also specify server:
//Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass, "blynk.cloud", 80);
//Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass, IPAddress(192,168,1,100), 8080);
}
void loop()
{
Blynk.run();
}