Page 1 of 1

LED Dim with PWM variable duty cycle

Posted: Tue Jun 17, 2025 1:50 pm
by canary_wharfe
Just done a search on the forum for examples of LED dimming using PWM and was amazed to see very little in the way of examples on what must be something pretty basic. Anyway the question is does the LED icon on a panel under simulation dim or is it just a digital on-off because I can't for the life of me think what I am doing wrong with the attached test circuit. The PWM part is working I just can't get the LED on the panel to light. I thought as I varied the duty cycle I'd see the LED brightness change. The LED is attached to the PWM o/p pin.

I started this using an ESP32 and when that didn't work decided to simplify things by getting it working in Flowcode using a PIC. Ideally what I'm trying to ultimately achieve is a PWM o/p with a Fq of 1Hz.

Re: LED Dim with PWM variable duty cycle

Posted: Tue Jun 17, 2025 2:06 pm
by medelec35
Hello,
No, with simulation, dimming an LED is not supported.
All you will see the LED remaining off.
LED should dim on embedded devices OK where the pins have PWM control.

Re: LED Dim with PWM variable duty cycle

Posted: Tue Jun 17, 2025 2:39 pm
by canary_wharfe
Well that's cleared that up. TBH Martin I'm sort of surprised when you realise Flowcode 10 has grown to be very sophisticated and something like simulating the LED brightness I thought would have been included by now. It really threw me on the simulation because I immediately assumed I had missed something under the property settings and spent nearly an hour thinking I had done something wrong. Anyway thanks for the quick answer.