PWM with ESP32


#1

Has anyone worked on PWM with the ESP32? I tried adding an Actuator/Generic/PWM Output, but I could not select my ESP32 device (Wemos ESP32 with attached 18650 battery charger/holder).

Ultimately I would like to control two motors for an RC car project.

Thanks!

Jeff


#2

welcome to cayenne community @jrankinen.

add a slider with channel 1 and a button for forward backward direction with channel 2. then code it accordingly. where slider sets the pwm speed control and button for direction.


#3

Did you get your project working? It looks like analogWrite is still not supported for the ESP32:

Development Status

Most of the framework is implemented. Most noticable is the missing analogWrite. While analogWrite is on it’s way, there are a few other options that you can use:

16 channels LEDC which is PWM
8 channels SigmaDelta which uses SigmaDelta modulation
2 channels DAC which gives real analog output