I am developing a sketch to to measure the flow rate of the water being pumped from a reservoir and transmit it to a central location.
I had some troubles in to develop the basic code but thanks to the help I got from this forum I am almost there.
The problem I need to tackle now is to how to measure the total volume transferred by the pump in each pumping cycle (the pump is turned on and of by a level sensor located at the discharge reservoir).
I tried to use flags but the code became so complex that I know from experience that I should be doing it wrong.
There is certainly a simpler way, but I am not seeing it.