From 5c333d3b5888b631475428a2213aa7b829d9109a Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Mon, 12 Aug 2019 15:56:39 +0700 Subject: [PATCH] Update WaterishOS-core2.0.ino --- WaterishOS-core2.0/WaterishOS-core2.0.ino | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/WaterishOS-core2.0/WaterishOS-core2.0.ino b/WaterishOS-core2.0/WaterishOS-core2.0.ino index 3fbf602..79b5858 100644 --- a/WaterishOS-core2.0/WaterishOS-core2.0.ino +++ b/WaterishOS-core2.0/WaterishOS-core2.0.ino @@ -37,14 +37,21 @@ boolean online = true; FlowMeter sensorA[6] = FlowMeter(1); FlowMeter sensorB[6] = FlowMeter(3); volatile boolean awakenByInterrupt = false; -LiquidCrystal_I2C lcd(0x27, 16, 2); +LiquidCrystal_I2C lcd(0x3F, 16, 2); int menu; +void writelcd(String line1, String line2){ + lcd.clear(); + lcd.print(line1); + lcd.setCursor(0,1); + lcd.print(line2); +} void drawmenu() { switch (menu) { case '1': lcd.print(" Waterish OS OK "); + break; } } @@ -69,12 +76,16 @@ void updatemqtt() { for (int counter; counter <= 6; counter++)mqtt.publish("/waterishos/node" + nodename + "/volumeB/" + counter, String(sensorB[counter].getTotalVolume())); } void setup() { + lcd.begin(); + writelcd(" Siwat INC (tm) "," Waterish OS"); + delay(1000); WiFi.mode(WIFI_STA); WiFi.begin(ssid, password); int connectionattempt = 0; while (WiFi.status() != WL_CONNECTED) { //wait for it ... (Wait for Wifi Connection) + writelcd("WiFi Connecting"," Attempt "+String(connectionattempt)); connectionattempt++; delay(500); if (connectionattempt >= 20) {