Generic Pulse Counter with LED indication?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
Metatron
Normal user
Posts: 39
Joined: 20 Mar 2021, 09:38

Generic Pulse Counter with LED indication?

#1 Post by Metatron » 19 Jan 2022, 07:57

Hello,

I am currently developping hardware for pulse counting with espeasy.
It would be very handy, if the onboard LED of my D1 mini would indicate a closed contact.
Can anyone please give me a hint, how to implement this?

Regards, Metatron

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

Re: Generic Pulse Counter with LED indication?

#2 Post by Ath » 19 Jan 2022, 09:40

There are no events triggered when a pulse is counted, as far as I can see, the closest you can get is to catch the event "on <PulsecounterTaskName>#Count do", and set the interval to 1 second.

A more tricky method could be to also configure a Switch device on the same GPIO, without any debounce settings, and handle the "on <SwitchTaskName>#State do" in a rule. That will trigger immediate when the pin state changes, but if the pulse frequency is > 1 Hz, most likely the ESP will either be very busy or crash, because it can't properly handle that kind of amount of rules processing (rules processing is not that fast, and quite CPU intensive).
So you may need to remove any unneeded rules (or comments), and place the 'high-frequency' rules as first in the Rules1 file.
/Ton (PayPal.me)

User avatar
Metatron
Normal user
Posts: 39
Joined: 20 Mar 2021, 09:38

Re: Generic Pulse Counter with LED indication?

#3 Post by Metatron » 22 Jan 2022, 18:20

Hello,

thank you, that works for me! (Using switch)

Regards, Metatron

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 19 guests