#define BLYNK_PRINT Serial
#define BLYNK_TEMPLATE_ID "TMPLNLcJaHIF"
#define BLYNK_DEVICE_NAME "photoresistor"
#define BLYNK_AUTH_TOKEN "kKjpG-BmqNgGvCZkCXq31EeYLmeSNa00"
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#include <ESP32Servo.h>
char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "Wokwi-GUEST";
char pass[] = "";
Servo servo;
BLYNK_WRITE(V0){
int val = param.asInt();
Serial.println("Servo berputar " + String(val) + "derajat");
servo.write(val);
delay(15);
}
void setup()
{
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
servo.attach(15);
}
void loop()
{
Blynk.run();
}