Update WaterishOS-core2.0.ino
This commit is contained in:
parent
714eebdcb5
commit
7c58baa772
|
@ -61,6 +61,7 @@ void ICACHE_RAM_ATTR readA() {
|
||||||
sensorA[pin].count();
|
sensorA[pin].count();
|
||||||
mqtt.publish("/waterishos/debug", "Aterupt");
|
mqtt.publish("/waterishos/debug", "Aterupt");
|
||||||
for (int counter=0; counter <= 15; counter++)mcp.digitalRead(counter);
|
for (int counter=0; counter <= 15; counter++)mcp.digitalRead(counter);
|
||||||
|
Serial.print("A interupted"+(int)digitalRead(14));
|
||||||
}
|
}
|
||||||
void ICACHE_RAM_ATTR readB() {
|
void ICACHE_RAM_ATTR readB() {
|
||||||
uint8_t pin = mcp.getLastInterruptPin();
|
uint8_t pin = mcp.getLastInterruptPin();
|
||||||
|
@ -100,20 +101,17 @@ void setup() {
|
||||||
if(online)writelcd(" WiFi Connected",wifiname);
|
if(online)writelcd(" WiFi Connected",wifiname);
|
||||||
delay(3000);
|
delay(3000);
|
||||||
writelcd("Boot Sequence P3"," Loading Kernel");
|
writelcd("Boot Sequence P3"," Loading Kernel");
|
||||||
pinMode(1, FUNCTION_3);
|
Serial.begin(115200);
|
||||||
pinMode(3, FUNCTION_3);
|
|
||||||
pinMode(1, INPUT);
|
|
||||||
pinMode(3, INPUT);
|
|
||||||
pinMode(14, INPUT);
|
pinMode(14, INPUT);
|
||||||
attachInterrupt(digitalPinToInterrupt(14), readA, RISING);
|
attachInterrupt(digitalPinToInterrupt(14), readA, RISING);
|
||||||
attachInterrupt(digitalPinToInterrupt(3), readB, RISING);
|
|
||||||
delay(1000);
|
delay(1000);
|
||||||
writelcd("Boot Sequence P3","Waking Processor");
|
writelcd("Boot Sequence P3","Waking Processor");
|
||||||
mcp.begin();
|
mcp.begin();
|
||||||
mcp.setupInterrupts(false, false, HIGH);
|
mcp.setupInterrupts(false, false, LOW);
|
||||||
for (int i = 0; i <= 15; i++)
|
for (int i = 0; i <= 15; i++)
|
||||||
{
|
{
|
||||||
mcp.pinMode(i, INPUT);
|
mcp.pinMode(i, INPUT);
|
||||||
|
mcp.pullUp(i, LOW);
|
||||||
mcp.setupInterruptPin(i, RISING);
|
mcp.setupInterruptPin(i, RISING);
|
||||||
}
|
}
|
||||||
delay(1000);
|
delay(1000);
|
||||||
|
@ -140,6 +138,7 @@ void setup() {
|
||||||
threadControl.add(&lcdmanager);
|
threadControl.add(&lcdmanager);
|
||||||
if(online)threadControl.add(&mqttupdater);
|
if(online)threadControl.add(&mqttupdater);
|
||||||
if(online)updatemqtt();
|
if(online)updatemqtt();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
|
|
Loading…
Reference in New Issue