Page 1 of 1

Help Need - PWM Servo Control with ESP32-S2

Posted: Tue Jun 11, 2024 2:49 pm
by BivvyCoder
I'm doing some development with an ESP32-S2 dev board and have been asked to add a servo motor.
I've tried the mcpwm_servo_control example in the IDE but can't get it to compile, for instance I get an error
  • MCPWM_TIMER_CLK_SRC_DEFAULT undeclared
The code has the motor control PWM library included

Code: Select all

#include "driver/mcpwm_prelude.h"
If I change the target to ESP32-C3 it compiles fine (and looking at the Readme file, the S2 is not listed as supported, so I guess I shouldn't be surprised.)

Two questions.
  • If it is, can anyone point me at an example that I can test and then use to develop my own application?
Many thanks

Re: Help Need - PWM Servo Control with ESP32-S2

Posted: Wed Jun 12, 2024 1:00 am
by ESP_Sprite
You may be able to use the LEDC peripheral instead.

Re: Help Need - PWM Servo Control with ESP32-S2

Posted: Tue Jul 09, 2024 1:19 pm
by BivvyCoder
That's great - thanks
Managed to use LEDC to create the required PWM signals