Non blocking blinking LED with PCA9685 possible?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
chromo23
Normal user
Posts: 827
Joined: 10 Sep 2020, 16:02
Location: germany

Non blocking blinking LED with PCA9685 possible?

#1 Post by chromo23 » 02 Nov 2023, 14:44

Is there a possibility to let a led connectet to a PCA9685 blink with out using "TimerSet"?
The Pulse command ist almost the right direction but there is no repeat option. Is it non-blocking anyhow?

Edit: Similar to "LongPulse_mS"

User avatar
Ath
Normal user
Posts: 3547
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Non blocking blinking LED with PCA9685 possible?

#2 Post by Ath » 02 Nov 2023, 14:56

AFAIK, the PcfLongpulse_MS command also shouldn't be blocking (where the Longpulse, and most likely PcfLongpulse too, are blocking), so maybe that helps in improving the performance?

Don't think the PcfLongpulse_MS command got that 'repeat' feature (though I didn't look at the source, the docs don't have that parameter), so a LoopTimerSet command would be the best starting point.
/Ton (PayPal.me)

User avatar
Ath
Normal user
Posts: 3547
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Non blocking blinking LED with PCA9685 possible?

#3 Post by Ath » 02 Nov 2023, 14:59

Hm, maybe the pcf* commands don't work with the PCA9685 :o
/Ton (PayPal.me)

User avatar
Ath
Normal user
Posts: 3547
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Non blocking blinking LED with PCA9685 possible?

#4 Post by Ath » 02 Nov 2023, 15:01

The frequency for the PCA9685 can't be set low enough to a usable flashing frequency (23 Hz is a really fast on/off) or else the PcaPwm command could have worked here :(
/Ton (PayPal.me)

User avatar
chromo23
Normal user
Posts: 827
Joined: 10 Sep 2020, 16:02
Location: germany

Re: Non blocking blinking LED with PCA9685 possible?

#5 Post by chromo23 » 02 Nov 2023, 15:08

Ath wrote: 02 Nov 2023, 14:59 Hm, maybe the pcf* commands don't work with the PCA9685
I got confused by that too :D

User avatar
chromo23
Normal user
Posts: 827
Joined: 10 Sep 2020, 16:02
Location: germany

Re: Non blocking blinking LED with PCA9685 possible?

#6 Post by chromo23 » 11 Dec 2023, 12:22

I use now the MCP23017 for relay and led output and the PCA9685 for input only.

To let the LEDs blink i use:

Code: Select all

MCPlongpulse_ms,1,0,1000,1000,5
Which is undocumented but works

Log output gives a warning (that's why it is probably undocumented?):
1602678: HTTP: MCPlongpulse_ms,1,0,1000,1000,5
1602683: Too many arguments: cmd=MCPlongpulse_ms Arg1=1 Arg2=0 (fixed) Arg3=1000,1000,5 ExtraArg4=1000 ExtraArg5=5 lineLength=31
1602683: Line: _MCPlongpulse_ms,1,0,1000,1000,5_
1602683: Command executed, but may fail. See: https://github.com/letscontrolit/ESPEasy/issues/2724
1602686: MCP : port 1. Pulse H:1000 L:1000 #:5 ms

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests