Hello, I am having a certain project in which i have to check whether particular amount of pulses is recieved from my flow sensor or not. for example, every 5 sec monitor if minimum 15 pulses are recieved or not. If not then show sensor fault. So hereby i am attaching my code below please guide me a little bit.
wvmarle:
That's a terribly formatted snipped, and for those two reasons can't say much about it.
here flow is what i incrementing when i m getting interrupt, minpul is the variable in which minimum pulses are decided per unit time. and timv is the time interval. What i want is in timv = 5000 i should get minpul = 15 atleast.. if not it should show that sensor is faulty and it should continously monitor even if one may resolve sensor fault.
If you want help with code, 1) format it in a way that it's readable (this is not a forum for entries to the obfuscated C contest) and 2) post your whole code, not snippets. Human readable variable names are a plus.
You say: "every 5 sec monitor if minimum 15 pulses are recieved or not".
So: every 5 seconds compare the current number of pulses with the number you had 5 seconds prior, if less than 15 difference raise an error.
wvmarle:
If you want help with code, 1) format it in a way that it's readable (this is not a forum for entries to the obfuscated C contest) and 2) post your whole code, not snippets. Human readable variable names are a plus.
You say: "every 5 sec monitor if minimum 15 pulses are recieved or not".
So: every 5 seconds compare the current number of pulses with the number you had 5 seconds prior, if less than 15 difference raise an error.
thats exactly i tried. i.e if(flow<minpul) and checked using millis