So I have been playing with a flow sensor for the last two weeks just reading the pulses with a interrupt. I now found out that this device has two pulses on two different wires one pulse is offset 90 degree from the other one. which ever pulse comes first determines the direction of flow in the pipe.
Can anyone suggest how to determine the direction from these two inputs? I thought of doing a if statement but if I just catch the wrong pulse first then the calculation will be off for the rest of the time.