Tasmota: Setup a PWM with 1024Bit

Hi,

short post today. It shows howto configure a GPIO Pin as PWM with a width of 1024Bits. Note the restrictions when using IO Ports.

Configure GPIO 14 to PWM 1.


Then setup the pwm by the following Commands

SetOption15 0
SetOption68 0
PwmFrequency 1000
PwmRange 1023

Now you can set the output pulsewith

pwm1 512
22:37:20.356 CMD: pwm1 512
22:37:20.364 MQT: switches/stat/display001/RESULT = {"PWM":{"PWM1":512}}


Michael

Leave a Reply