14#include "esp_arduino_version.h"
77 explicit Motor(
const uint8_t positive_pin,
const uint8_t negative_pin);
116 explicit Motor(
const uint8_t positive_pin,
117 const uint8_t positive_pin_ledc_channel,
118 const uint8_t negative_pin,
119 const uint8_t negative_pin_ledc_channel);
171 const uint8_t positive_pin_ = 0xFF;
172 const uint8_t negative_pin_ = 0xFF;
173 const uint8_t positive_pin_ledc_channel_ = 0xFF;
174 const uint8_t negative_pin_ledc_channel_ = 0xFF;
175 int16_t pwm_duty_ = 0;
static constexpr uint8_t kPwmResolution
The resolution of PWM, which determines the fine-tuning level of the PWM duty cycle,...
void RunPwmDuty(const int16_t pwm_duty)
Set motor PWM directly.
static constexpr int16_t kMaxPwmDuty
The maximum PWM duty cycle value calculated based on the PWM resolution.
int16_t PwmDuty() const
Get the PWM pwm_duty cycle of the motor driver.
Motor(const uint8_t positive_pin, const uint8_t negative_pin)
Constructor for creating an Motor object.
static constexpr uint8_t kPwmFrequency
The frequency of PWM, in Hertz. Here it is set to 75000 Hz, used to control the frequency of the PWM ...