#include <ESP32Servo360.h>
#define PIN_SG90 22 // Broche de sortie utilisée
ESP32Servo360 sg90;
void setup() {
servo.adjustSignal(int minPulseWidth = 32, int maxPulseWidth = 1067);
servo.calibrate(PIN_SG90);
}
void loop() {
// Rotation de 0 à 180°
for (int pos = 0; pos <= 360; pos += 1) {
sg90.rotate(pos);
delay(10);
}
// Rotation de 180° à 0°
for (int pos = 360; pos >= 0; pos -= 1) {
sg90.rotate(pos);
delay(10);
}
}