LED Dim with PWM variable duty cycle

Use this section to discuss your embedded Flowcode projects.
Post Reply
canary_wharfe
Posts: 110
http://meble-kuchenne.info.pl
Joined: Thu Dec 10, 2020 3:54 pm
Has thanked: 6 times
Been thanked: 12 times

LED Dim with PWM variable duty cycle

Post 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.
Attachments
PWMDemo.fcfx
(13.68 KiB) Downloaded 11 times

medelec35
Matrix Staff
Posts: 1994
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 630 times
Been thanked: 666 times

Re: LED Dim with PWM variable duty cycle

Post 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.
Martin

canary_wharfe
Posts: 110
Joined: Thu Dec 10, 2020 3:54 pm
Has thanked: 6 times
Been thanked: 12 times

Re: LED Dim with PWM variable duty cycle

Post 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.

Post Reply