#include // Servo objects Servo servo1; Servo servo2; // Pins const int SERVO1_PIN = 1; // GPIO1 const int SERVO2_PIN = 2; // GPIO2 void setup() { Serial.begin(115200); delay(1000); // ESP32-S3 requires explicit PWM timer setup ESP32PWM::allocateTimer(0); ESP32PWM::allocateTimer(1); // Attach servos with pulse range (MG90S typical) servo1.attach(SERVO1_PIN, 500, 2400); servo2.attach(SERVO2_PIN, 500, 2400); Serial.println("Dual MG90S servo control ready."); } void loop() { // Sweep example for (int pos = 0; pos <= 180; pos++) { servo1.write(pos); servo2.write(180 - pos); delay(10); } for (int pos = 180; pos >= 0; pos--) { servo1.write(pos); servo2.write(180 - pos); delay(10); } }