#include <ESP32Servo.h>
Servo motor1;
Servo motor2;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
motor1.attach(23);
motor2.attach(4);
}
void loop() {
motor1.write(0); motor2.write(180);
delay(1000);
motor1.write(90); motor2.write(90);
delay(1000);
}
Loading
esp32-devkit-c-v4
esp32-devkit-c-v4
servo1:GND
servo1:V+
servo1:PWM
servo2:GND
servo2:V+
servo2:PWM