//#include <Servo.h>
#define BLYNK_TEMPLATE_ID "TMPL60vyD_QAl"
#define BLYNK_TEMPLATE_NAME "1st Template"
#define BLYNK_AUTH_TOKEN "yrjXZCU3nh0yx9VwX740DM23n3EYxOB8"
#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
//Servo servo1;
char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "Wokwi-GUEST";
char pass[] = "";
int pinled = 26;
int move=0;
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");
}
}
BLYNK_WRITE(V1){
move = param.asInt();
}
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);
//servo1.attach(4);
}
void loop() {
// put your main code here, to run repeatedly:
delay(1000); // this speeds up the simulation
Blynk.run();
//servo1.write(move);
}