|
@@ -78,10 +78,8 @@ public:
|
78
|
78
|
|
79
|
79
|
// Get the total flow (in liters per minute) since the last reading
|
80
|
80
|
static void calc_flowrate() {
|
81
|
|
- //flowmeter_interrupt_disable();
|
82
|
|
- // const uint16_t pulses = flowpulses;
|
83
|
|
- //flowmeter_interrupt_enable();
|
84
|
|
- flowrate = flowpulses * 60.0f * (1000.0f / (FLOWMETER_INTERVAL)) * (1000.0f / (FLOWMETER_PPL));
|
|
81
|
+ // flowrate = (litres) * (seconds) = litres per minute
|
|
82
|
+ flowrate = (flowpulses / (float)FLOWMETER_PPL) * ((1000.0f / (float)FLOWMETER_INTERVAL) * 60.0f);
|
85
|
83
|
flowpulses = 0;
|
86
|
84
|
}
|
87
|
85
|
|