18 #ifndef WS_ESP32_SERVO 19 #define WS_ESP32_SERVO 24 #define MIN_PULSE_WIDTH 544 25 #define MAX_PULSE_WIDTH 2400 26 #define INVALID_SERVO 255 28 #define DEFAULT_SERVO_FREQ 50 29 #define LEDC_TIMER_WIDTH \ 64 uint8_t
attach(
int pin,
int minPulseWidth,
int maxPulseWidth,
int servoFreq);
75 #endif // WS_ESP32_SERVO Definition: ws_ledc_servo.h:37
uint8_t isActive
True if the servo is enabled.
Definition: ws_ledc_servo.h:39
High-level interface for the ESP32/ESP32-Sx/ESP32-Cx LED Control (LEDC) peripheral. Instead of specifying a timer or channel, this class automatically allocates a channel and associates it with a pin. Underlying esp32-hal-ledc performs timer management and handles the low-level LEDC peripheral API calls.
Definition: ws_ledc.h:37
uint8_t attach(int pin, int minPulseWidth, int maxPulseWidth, int servoFreq)
Attaches a servo object to a pin.
Definition: ws_ledc_servo.cpp:62
void detach()
Detaches the servo (ledc timer) and de-allocates a servo object.
Definition: ws_ledc_servo.cpp:81
Definition: ws_ledc_servo.h:43
void writeMicroseconds(int value)
Writes the pulse width to the connected servo pin.
Definition: ws_ledc_servo.cpp:100
bool attached()
Returns if the servo is attached to a ledc timer.
Definition: ws_ledc_servo.cpp:92
High-level driver for servos for ESP32/ESP32-Sx/ESP32-Cx. This driver implements a subset of the func...
Definition: ws_ledc_servo.h:57
~ws_ledc_servo()
Destructor.
Definition: ws_ledc_servo.cpp:37
void setLEDCDriver(ws_ledc *ledcManager)
Sets a LEDC driver for use with servo objects.
Definition: ws_ledc_servo.cpp:47
ws_ledc_servo()
Constructor.
Definition: ws_ledc_servo.cpp:30
ServoPin_t Pin
Servo properties.
Definition: ws_ledc_servo.h:44
uint8_t nbr
Servo's pin number.
Definition: ws_ledc_servo.h:38