40 lines
532 B
C++
40 lines
532 B
C++
#include "MqttMonitor.h"
|
|
|
|
#include <Metro.h>
|
|
#include <Streaming.h>
|
|
#include <avr/wdt.h>
|
|
|
|
|
|
#include "hmi.h"
|
|
#include "mqttclient.h"
|
|
|
|
Hmi hmi = Hmi();
|
|
Metro tick = Metro(25000); // 25s
|
|
|
|
void setup() {
|
|
Serial.begin(9600);
|
|
|
|
hmi.begin();
|
|
hmi.tft()->println("Starting up");
|
|
|
|
MqttClientNS::begin();
|
|
|
|
hmi.tft()->println("Running");
|
|
delay(10000);
|
|
|
|
hmi.clear();
|
|
|
|
wdt_enable(WDTO_8S);
|
|
}
|
|
|
|
void loop() {
|
|
if (tick.check()) {
|
|
Serial << "tick" << endl;
|
|
}
|
|
|
|
hmi.exec();
|
|
|
|
MqttClientNS::exec();
|
|
|
|
}
|