I need a best practice advice. I need count pulses arriving at one pin. Super simple, yes? The source is a liquid flow monitor. The pulses per gallon are well known so the issue here isn't around math. It is around best practice.
I figured I can simply increment a counter with each pulse which will give me liquid dispensed since boot. That's just fine, but what about overflow? Eventually the counter will overflow, what is the best practice advice around this?
My second question is around involving time - if I would like to have PPM for example saved in a variable which could can be sent out via the serial port every 5 seconds or so, would you point me to some examples.
So in summary, I need to know total liquid dispensed so far in absolute terms and also a time driven PPM measure
Thank you ~B