I finally got my water meter/alarm sketch working! I have only been doing Arduino for a few weeks. (Thanks to other users who gave me advice!).
It pretty much is doing what I want it to, except, that it is somewhat slow to read my flow meter, which it is doing with the “get_frequency” function in the program. There is a lag of a few seconds before the LED goes on and the water starts getting measured…so it apparently is losing some of the water measurement for short turn-ons.
I assume this is because the program is executing calls and doing calculations. I put in a “goto” to skip sections of code under certain conditions, but the lag is still there.
This reading of the flow meter was faster earlier in the sketch development, but that version was not correctly calculating the water use (GPM).
Any advice?? Thanks for your help!
water_timer1_25_2016.ino (6.5 KB)