2016-03-02 17:30:46 +01:00
|
|
|
#include "MqttMonitor.h"
|
|
|
|
|
2016-03-03 23:19:56 +01:00
|
|
|
#include <Metro.h>
|
|
|
|
#include <Streaming.h>
|
2016-07-10 18:38:53 +02:00
|
|
|
#include <avr/wdt.h>
|
|
|
|
|
2016-03-02 17:30:46 +01:00
|
|
|
|
2016-03-03 23:19:56 +01:00
|
|
|
#include "hmi.h"
|
2016-10-29 23:45:24 +02:00
|
|
|
#include "mqttclient.h"
|
2016-03-03 23:19:56 +01:00
|
|
|
|
|
|
|
Hmi hmi = Hmi();
|
|
|
|
Metro tick = Metro(25000); // 25s
|
|
|
|
|
|
|
|
void setup() {
|
|
|
|
Serial.begin(9600);
|
|
|
|
|
|
|
|
hmi.begin();
|
2016-03-06 15:45:33 +01:00
|
|
|
hmi.tft()->println("Starting up");
|
2016-03-03 23:19:56 +01:00
|
|
|
|
|
|
|
MqttClientNS::begin();
|
2016-03-06 15:45:33 +01:00
|
|
|
|
|
|
|
hmi.tft()->println("Running");
|
|
|
|
delay(10000);
|
2016-07-10 18:38:53 +02:00
|
|
|
|
|
|
|
hmi.clear();
|
|
|
|
|
|
|
|
wdt_enable(WDTO_8S);
|
2016-03-02 17:30:46 +01:00
|
|
|
}
|
|
|
|
|
2016-03-03 23:19:56 +01:00
|
|
|
void loop() {
|
|
|
|
if (tick.check()) {
|
|
|
|
Serial << "tick" << endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
hmi.exec();
|
|
|
|
|
|
|
|
MqttClientNS::exec();
|
|
|
|
|
2016-03-02 17:30:46 +01:00
|
|
|
}
|