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
Generic Pulse Counter with LED indication?
Moderators: grovkillen, Stuntteam, TD-er
Re: Generic Pulse Counter with LED indication?
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.
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)
Re: Generic Pulse Counter with LED indication?
Hello,
thank you, that works for me! (Using switch)
Regards, Metatron
thank you, that works for me! (Using switch)
Regards, Metatron
Who is online
Users browsing this forum: No registered users and 70 guests