4#include "driver/gpio.h"
5#include "driver/ledc.h"
22 explicit EspServoOutput(gpio_num_t pin, ledc_channel_t ledcChannel,
bool initialLevel =
false);
30 [[nodiscard]]
bool getLevel()
const override;
33 void setAngle(uint32_t angleDegrees);
36 ledc_channel_t m_channel;
40 static constexpr uint32_t SERVO_FREQ_HZ = 50;
41 static constexpr uint32_t SERVO_PERIOD_US = 20000;
42 static constexpr uint32_t SERVO_MIN_PULSE_US = 1000;
43 static constexpr uint32_t SERVO_MAX_PULSE_US = 2000;
44 static constexpr uint32_t SERVO_ANGLE_CLOSED = 90;
45 static constexpr uint32_t SERVO_ANGLE_OPEN = 0;
ESP32 implementation of servo control via PWM.
Definition EspServoOutput.h:14
~EspServoOutput() override
Definition EspServoOutput.cpp:58
bool getLevel() const override
Get current GPIO output level.
Definition EspServoOutput.cpp:73
EspServoOutput & operator=(const EspServoOutput &)=delete
EspServoOutput(const EspServoOutput &)=delete
void setLevel(bool high) override
Set GPIO output level.
Definition EspServoOutput.cpp:63
Interface for GPIO output abstraction.
Definition IGpioOutput.h:9