// Prepare and then apply the LEDC PWM timer configuration
ledc_timer_config_t ledc_timer = {
.speed_mode = LEDC_LOW_SPEED_MODE,
.timer_num = LEDC_TIMER_1,
.duty_resolution = LEDC_TIMER_9_BIT,
.freq_hz = 8000, // Set output frequency at 8 kHz
.clk_cfg = LEDC_USE_RTC8M_CLK
};
// Prepare and then apply the LEDC PWM channel configuration
ledc_channel_config_t ledc_channel = {
.speed_mode = LEDC_LOW_SPEED_MODE,
.channel = LEDC_CHANNEL_3,
.timer_sel = LEDC_TIMER_1,
.intr_type = LEDC_INTR_DISABLE,
.gpio_num = 5,
.duty = 0, // Set duty to 0%
.hpoint = 0,
.flags.output_invert = 1
};
// Prepare and then apply the LEDC PWM timer configuration
ledc_timer_config_t ledc_timer = {
.speed_mode = LEDC_LOW_SPEED_MODE,
.timer_num = LEDC_TIMER_1,
.duty_resolution = LEDC_TIMER_9_BIT,
.freq_hz = 8000, // Set output frequency at 8 kHz
.clk_cfg = LEDC_USE_RTC8M_CLK
};
// Prepare and then apply the LEDC PWM channel configuration
ledc_channel_config_t ledc_channel = {
.speed_mode = LEDC_LOW_SPEED_MODE,
.channel = LEDC_CHANNEL_3,
.timer_sel = LEDC_TIMER_1,
.intr_type = LEDC_INTR_DISABLE,
.gpio_num = 5,
.duty = 0, // Set duty to 0%
.hpoint = 0,
.flags.output_invert = 1
};
举报