Adafruit Library
Classes | Macros
ws_ledc_servo.h File Reference
#include "components/ledc/ws_ledc.h"

Go to the source code of this file.

Classes

struct  ServoPin_t
 
struct  servo_t
 
class  ws_ledc_servo
 High-level driver for servos for ESP32/ESP32-Sx/ESP32-Cx. This driver implements a subset of the functions within the Arduino servo library, (https://github.com/arduino-libraries/Servo/blob/master/src/Servo.h). More...
 

Macros

#define MIN_PULSE_WIDTH   544
 The shortest pulse sent to a servo.
 
#define MAX_PULSE_WIDTH   2400
 The longest pulse sent to a servo.
 
#define INVALID_SERVO   255
 Flag indicating an invalid servo index.
 
#define DEFAULT_SERVO_FREQ   50
 default servo frequency
 
#define LEDC_TIMER_WIDTH   12
 

Detailed Description

Driver for ESP32 servo control using the WipperSnapper LEDC peripheral manager API.

Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!

Brent Rubell for Adafruit Industries 2022

MIT license, all text here must be included in any redistribution.

Macro Definition Documentation

◆ LEDC_TIMER_WIDTH

#define LEDC_TIMER_WIDTH   12

timer width to request from LEDC manager component, in bits (NOTE: While ESP32x can go up to 16 bit timer width, ESP32-S2 does not work at this resolution. So, for the purposes of keeping this library compatible with multiple ESP32x platforms, the timer width has been scaled down to 10 bits and the calculation adjusted accordingly)