Quote
WHAT'S NEEDED:
A circuit that will accept the first ON/OFF pulse and ignore everything else.
A circuit that will accept the first ON/OFF pulse and ignore everything else.
You can do this in hardware or software - in hardware, you can use a d-type or a jk flip-flop. Have a, "arm" button which initialises the circuit, then when the sensor state changes the flip flop changes state again and can't revert back unless armed again.
In software it is the same. Have an "arm" button. When pressed sets a variable to "armed". You only take notice of the start sensor level changed when "armed". As soon as the sensor level changes set the "armed" variable to "triggered" so that any further level changes will be ignored.
Doing it in software is favourite, in my opinion, as there are no parts to buy and it affords some flixibilty.
Mike