#include <Arduino.h> #include <Servo.h> #define SERVO_PIN D4 // GPIO2 Servo myServo; int angle = 0; int direction = 1; void setup() { Serial.begin(115200); myServo.attach(SERVO_PIN); Serial.println("Servo Control Started!"); }