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