#define BLYNK_TEMPLATE_ID "TMPL3qtzkjSn8"
#define BLYNK_TEMPLATE_NAME "ServoHome"
#define BLYNK_AUTH_TOKEN "9u-20jwvofMfdaUcL4O1LzAffDm5vs3G"
#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <BlynkSimpleEsp32.h>
#include <ESP32Servo.h>
char auth[] = BLYNK_AUTH_TOKEN; // Blynk authentication token
char ssid[] = "Wokwi-GUEST"; // Your WiFi SSID
char pass[] = ""; // Your WiFi password
Servo servo1;
//Servo servo2;
void setup()
{
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
servo1.attach(18); // Attach servo 1 to GPIO 2
}
void loop()
{
Blynk.run();
}
BLYNK_WRITE(V0) // Slider Widget for Servo 1 on V0
{
int pos1 = param.asInt(); // Get value from slider
servo1.write(pos1); // Set servo 1 position
}