Hi all
I have finally managed to break into my front gate controller which has an ‘Open Gate Indicator’ output. I have connected this output to the trigger side of a 24v relay and intend to connect the switched side of relay to connect a ground to an input pin on my Nodemcu (I believe I need to use one of the pins with internal pull-up).
The gate controller outputs 3 ‘pulse rates’
Opening = slow pulse (maybe every 500ms)
Open = high
Closing = fast pulse (maybe we’ve 200ms).
I would like to
A) drive Blynk LED to replicate gate controller output (ok with this just reading input pin high/low
B) Simple solution: create notification once only on first change in signal (from high to low, assuming I do indeed use pull-up).
C) slightly more complicated: in addition to a) a 2nd notification when input pin returns to high for say greater then 2 seconds
D) More complicated: create notifications for each of the 3 gate status (opening, open and closing).
Struggling a bit with options b) c) & d) and whether to use interval, interrupt, millis(), RTC or a combination of all the above.
To correctly notify I assume I need to be able to determine the pulse rate and then calculate whether it’s a slow or fast pulse. Calling a function with a timer feels problematic here as it may assume fast pulse if it is called towards the end of a pulse (if that make sense)
Would appreciate any thoughts/advice on which road to go down.