// Servo Sweep example for the ESP32
// https://wokwi.com/arduino/projects/323706614646309460
#include <ESP32Servo.h>
const int servoPin = 18;
const int PULSADOR1 = 32;
Servo servo;
void setup() {
servo.attach(servoPin);
pinMode(PULSADOR1, INPUT);
Serial.begin(9600);
}
void loop() {
if (digitalRead(PULSADOR1) == HIGH) {
servo.write(0);
delay(1500);
servo.write(90);
delay(1500);
servo.write(180);
delay(1500);
}
}