Hi Rui & Sara,
I am trying to control my solid state relay using PWM, such that the relay stays ON for 5sec and OFF for 1sec but it seems that ESP32 LEDC function doesn’t allow for frequency below 1Hz.
I have tried using millis() to time the ON and OFF, but that is not as accurate as using PWM.
I think this discussion answers your question: https://forum.arduino.cc/t/esp32-what-is-the-minimum-pwm-frequency/671077/4
Have you tried using delay() to control the relay on and off for a determined number of seconds?
In some scenarios, you can use delay() if it doesn’t compromise the rest of the code.
Delay() is blocking function, just to many limitation by using it. Using millis() is much better approach, but that does not solve my problem either.
Anyway, based on my experimentation, frequency below 1Hz is possible by setting the resolution to 16-bit.
Testing it now. hopefully this is the solution to my problem