Skip to content

Commit

Permalink
feat: 🎨 convert flow to cubic meters
Browse files Browse the repository at this point in the history
  • Loading branch information
Vini7Dev committed Jul 1, 2023
1 parent 7161e0d commit 3fb4e31
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions hydrometer/hydrometer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# define SECONDS_PER_MINUTE 60
# define MINUTES_PER_HOUR 60
# define MILILITER_PER_LITER 1000
# define METERS_PER_LITER 0.001

#include <ESP8266WiFi.h>
#include <PubSubClient.h>
Expand Down Expand Up @@ -75,6 +76,7 @@ void calculateFlow() {
totalFlow = totalFlow * SECONDS_PER_MINUTE;
totalFlow = totalFlow * MINUTES_PER_HOUR;
totalFlow = totalFlow / MILILITER_PER_LITER;
totalFlow = totalFlow * METERS_PER_LITER;

flowRate = totalFlow / (elapsedTime / 3600000.0);

Expand Down

0 comments on commit 3fb4e31

Please sign in to comment.