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...
#include <ws_ledc_servo.h>
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).
◆ setLEDCDriver()
void ws_ledc_servo::setLEDCDriver |
( |
ws_ledc * |
ledcManager | ) |
|
Sets a LEDC driver for use with servo objects.
- Parameters
-
ledcManager | Pointer to LEDC driver. |
◆ attach()
uint8_t ws_ledc_servo::attach |
( |
int |
pin, |
|
|
int |
minPulseWidth, |
|
|
int |
maxPulseWidth, |
|
|
int |
servoFreq |
|
) |
| |
Attaches a servo object to a pin.
- Parameters
-
pin | Desired GPIO pin. |
minPulseWidth | Minimum pulsewidth, in uS. |
maxPulseWidth | Maximum pulsewidth, in uS. |
servoFreq | Desired servo frequency, in Hz. |
- Returns
- Channel number if a servo is successfully attached to a pin, otherwise 255.
◆ attached()
bool ws_ledc_servo::attached |
( |
| ) |
|
Returns if the servo is attached to a ledc timer.
- Returns
- True if the servo is attached to a timer, False otherwise.
◆ writeMicroseconds()
void ws_ledc_servo::writeMicroseconds |
( |
int |
value | ) |
|
Writes the pulse width to the connected servo pin.
- Parameters
-
value | Desired pulse width, in microseconds. |
The documentation for this class was generated from the following files: