From 7c58baa772268af5ad28ccefec94808bf02ae7c8 Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Mon, 12 Aug 2019 20:54:10 +0700 Subject: [PATCH] Update WaterishOS-core2.0.ino --- WaterishOS-core2.0/WaterishOS-core2.0.ino | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/WaterishOS-core2.0/WaterishOS-core2.0.ino b/WaterishOS-core2.0/WaterishOS-core2.0.ino index 6c78e49..0c21191 100644 --- a/WaterishOS-core2.0/WaterishOS-core2.0.ino +++ b/WaterishOS-core2.0/WaterishOS-core2.0.ino @@ -61,6 +61,7 @@ void ICACHE_RAM_ATTR readA() { sensorA[pin].count(); mqtt.publish("/waterishos/debug", "Aterupt"); for (int counter=0; counter <= 15; counter++)mcp.digitalRead(counter); + Serial.print("A interupted"+(int)digitalRead(14)); } void ICACHE_RAM_ATTR readB() { uint8_t pin = mcp.getLastInterruptPin(); @@ -100,20 +101,17 @@ void setup() { if(online)writelcd(" WiFi Connected",wifiname); delay(3000); writelcd("Boot Sequence P3"," Loading Kernel"); - pinMode(1, FUNCTION_3); - pinMode(3, FUNCTION_3); - pinMode(1, INPUT); - pinMode(3, INPUT); + Serial.begin(115200); pinMode(14, INPUT); attachInterrupt(digitalPinToInterrupt(14), readA, RISING); - attachInterrupt(digitalPinToInterrupt(3), readB, RISING); delay(1000); writelcd("Boot Sequence P3","Waking Processor"); mcp.begin(); - mcp.setupInterrupts(false, false, HIGH); + mcp.setupInterrupts(false, false, LOW); for (int i = 0; i <= 15; i++) { mcp.pinMode(i, INPUT); + mcp.pullUp(i, LOW); mcp.setupInterruptPin(i, RISING); } delay(1000); @@ -140,6 +138,7 @@ void setup() { threadControl.add(&lcdmanager); if(online)threadControl.add(&mqttupdater); if(online)updatemqtt(); + } void loop() {