Приведу скетч здесь, так как скетча для калибровки регулятора с режимом реверса не видел.
// if CW & CCW
#define ESC_REVERSE
#if defined(ESP32)
#include <ESP32_Servo.h> // https://github.com/jkb-git/ESP32Servo/tree/master/examples
#else
#include <Servo.h>
#endif
Servo motor;
int mot_pin = 9;
int max_pwm = 2000;
int min_pwm = 1000;
int pwm = 1500;
int bottom = 7;
void setup() {
Serial.begin(115200);
pinMode(bottom, INPUT_PULLUP);
motor.attach(mot_pin);
delay(1000);
// Calibrate ESC
if (!digitalRead(bottom)) {
motor.writeMicroseconds(max_pwm);
delay(2000);
motor.writeMicroseconds(min_pwm);
delay(4000);
}
#ifdef ESC_REVERSE
motor.writeMicroseconds(pwm);
#else
motor.writeMicroseconds(min_pwm);
#endif
}
void loop() {
pwm = analogRead(A0);
motor.writeMicroseconds(map(pwm, 0, 1023, 1000, 2000));
delay(10);
}