From bf77ea06977bb23df38b845de4c26e544aadf695 Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Mon, 12 Aug 2019 17:08:44 +0700 Subject: [PATCH] Update WaterishOS-core2.0.ino --- WaterishOS-core2.0/WaterishOS-core2.0.ino | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/WaterishOS-core2.0/WaterishOS-core2.0.ino b/WaterishOS-core2.0/WaterishOS-core2.0.ino index 7454b22..96f20c7 100644 --- a/WaterishOS-core2.0/WaterishOS-core2.0.ino +++ b/WaterishOS-core2.0/WaterishOS-core2.0.ino @@ -67,10 +67,10 @@ void collectdata() { for (int sid = 8; sid < 13; sid++)sensorB[sid - 8].tick(1000); } void updatemqtt() { - for (int counter; counter <= 6; counter++)mqtt.publish("/waterishos/node" + nodename + "/flowrateA/" + counter, String(sensorA[counter].getCurrentFlowrate())); - for (int counter; counter <= 6; counter++)mqtt.publish("/waterishos/node" + nodename + "/volumeA/" + counter, String(sensorA[counter].getTotalVolume())); - for (int counter; counter <= 6; counter++)mqtt.publish("/waterishos/node" + nodename + "/flowrateB/" + counter, String(sensorB[counter].getCurrentFlowrate())); - for (int counter; counter <= 6; counter++)mqtt.publish("/waterishos/node" + nodename + "/volumeB/" + counter, String(sensorB[counter].getTotalVolume())); + for (int counter=0; counter <= 5; counter++)mqtt.publish("/waterishos/node" + nodename + "/flowrateA/" + String(counter+1), String(sensorA[counter].getCurrentFlowrate())); + for (int counter=0; counter <= 5; counter++)mqtt.publish("/waterishos/node" + nodename + "/volumeA/" + String(counter+1), String(sensorA[counter].getTotalVolume())); + for (int counter=0; counter <= 5; counter++)mqtt.publish("/waterishos/node" + nodename + "/flowrateB/" + String(counter+1), String(sensorB[counter].getCurrentFlowrate())); + for (int counter=0; counter <= 5; counter++)mqtt.publish("/waterishos/node" + nodename + "/volumeB/" + String(counter+1), String(sensorB[counter].getTotalVolume())); } void setup() { lcd.begin();