This is my C port of the library below.
ESP32Servo *myServo;
myServo = = ESP32Servo_create(GPIO_NUM_23,400,2600,LEDC_CHANNEL_0,LEDC_TIMER_0);
for (int i = 0; i<180; i++){
ESP32Servo_write(myServo,i);
vTaskDelay(10 / portTICK_RATE_MS);
}
ESP32Servo_free(myServo);
This idf-component permits to control hobby-grade servo motors using an Espressif's ESP32 SoC (running esp-idf)
Tested with TowerPro - SG92R and ESP32D0WDQ6 (DevKitC).
NOTE: this code is not (yet) Production Ready.
You can use this library as a component for your project:
mkdir -p <YOUR_PROJECT_ROOT>/components/
cd <YOUR_PROJECT_ROOT>/components/
git clone https://github.com/ShellAddicted/ESP32Servo.git
for more details see examples/