Skip to menu

Robotics with Object Pascal

ESP32-S3 super mini experience

Servo Demo

2025.04.25 14:10

me Views:40

#include <ESP32Servo.h>

static const int servoPin = 1;  //  Servo is connected to GP1

Servo servo1;

void setup() {

  Serial.begin(115200);
  servo1.attach(servoPin);
}

void loop() {
  for(int posDegrees = 0; posDegrees <= 180; posDegrees++) {
    servo1.write(posDegrees);
    Serial.println(posDegrees);
    delay(20);
  }