From 7311f7788804f51a0b9d5b7d532d63b5a21cbdd9 Mon Sep 17 00:00:00 2001 From: Michael Jonathan Date: Fri, 21 Jul 2023 16:35:37 +0700 Subject: [PATCH 1/2] Update the frequency to flow equations Fix the incorrect frequency to flow rate equations, will do testing in the future --- example_YF-B10_flow_sensor.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example_YF-B10_flow_sensor.ino b/example_YF-B10_flow_sensor.ino index 3cd4a96..9e893f7 100644 --- a/example_YF-B10_flow_sensor.ino +++ b/example_YF-B10_flow_sensor.ino @@ -67,7 +67,7 @@ void loop() // As we have a add operation we need to avoid the positive value when no pulse is found if (tmp > 0) { - flowRate = tmp / calibrationFactor + calibrationDifference; + flowRate = (tmp / calibrationDifference) / calibrationFactor; }else { flowRate = 0; } From c3d1ebc0446024beeaed897def37c56813fbf745 Mon Sep 17 00:00:00 2001 From: Michael Jonathan Date: Fri, 15 Nov 2024 22:00:55 +0000 Subject: [PATCH 2/2] Update example_YF-B10_flow_sensor.ino, solve the wrong division --- example_YF-B10_flow_sensor.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example_YF-B10_flow_sensor.ino b/example_YF-B10_flow_sensor.ino index 9e893f7..d6ba4e9 100644 --- a/example_YF-B10_flow_sensor.ino +++ b/example_YF-B10_flow_sensor.ino @@ -67,7 +67,7 @@ void loop() // As we have a add operation we need to avoid the positive value when no pulse is found if (tmp > 0) { - flowRate = (tmp / calibrationDifference) / calibrationFactor; + flowRate = (tmp + calibrationDifference) / calibrationFactor; }else { flowRate = 0; }