no message

This commit is contained in:
Siwat Sirichai 2019-09-04 21:22:18 +07:00
parent 435a92b5f8
commit e18a5c97c3
1 changed files with 20 additions and 8 deletions

View File

@ -30,6 +30,7 @@
Adafruit_MCP23017 mcp; Adafruit_MCP23017 mcp;
long tslr = 0; long tslr = 0;
WiFiClient espClient; WiFiClient espClient;
boolean allowbuttonint=true;
AceButton gpio0(0); AceButton gpio0(0);
PubSubClient client("siwatsystem.com", 1883, espClient); PubSubClient client("siwatsystem.com", 1883, espClient);
PubSubClientTools mqtt(client); PubSubClientTools mqtt(client);
@ -44,6 +45,7 @@ boolean firstrun = true;
FlowMeter sensor1 = FlowMeter(12); FlowMeter sensor1 = FlowMeter(12);
FlowMeter sensor2 = FlowMeter(13); FlowMeter sensor2 = FlowMeter(13);
boolean devcon=false; boolean devcon=false;
int devconmenu=0;
volatile boolean awakenByInterrupt = false; volatile boolean awakenByInterrupt = false;
LiquidCrystal_I2C lcd(0x3F, 16, 2); LiquidCrystal_I2C lcd(0x3F, 16, 2);
int menu; int menu;
@ -165,27 +167,37 @@ void setup() {
void loop() { void loop() {
if(online)client.loop(); if(online)client.loop();
threadControl.run(); if(!devcon)threadControl.run();
gpio0.check(); if(allowbuttonint)gpio0.check();
}
void drawcon(){
()
} }
void handleGPIO0(AceButton* , uint8_t eventType, void handleGPIO0(AceButton* , uint8_t eventType,
uint8_t ) { uint8_t ) {
switch (eventType) { switch (eventType) {
case AceButton::kEventPressed: case AceButton::kEventPressed:
if(devcon=false){
allowbuttonint=false;
devcon=true; //no going back, Delete Waterish OS and Install Siwat INC(R) DEVCON OS devcon=true; //no going back, Delete Waterish OS and Install Siwat INC(R) DEVCON OS
lcd.print(" SIWAT INC(R) ","DEVCON OS V3.2.4"); writelcd(" SIWAT INC(R) ","DEVCON OS V3.2.4");
delay(1000); delay(1000);
lcd.print("DEVCON TOOLKITS","3 Extension Load"); writelcd("DEVCON TOOLKITS","3 Extension Load");
delay(1000); delay(1000);
lcd.print("Initia Extension","connectionchck.c"); writelcd("Initia Extension","connectionchck.c");
delay(2000); delay(2000);
lcd.print("Initia Extension","hall_pid_tuner.c") writelcd("Initia Extension","hall_pid_tuner.c")
delay(2000); delay(2000);
lcd.print("Initia Extension","credit_display.c"); writelcd("Initia Extension","credit_display.c");
delay(2000); delay(2000);
lcd.print("DEVCON TOOLKITS","set WTOS at 0x3D"); writelcd("DEVCON TOOLKITS","set WTOS at 0x3D");
delay(1000); delay(1000);
allowbuttonint=true
devconmenu=1;
drawcon();
break; break;
}
case AceButton::kEventReleased: case AceButton::kEventReleased:
//debounce //debounce
break; break;