Files
esp_jardin/src/main.cpp
T

32 lines
855 B
C++

#include <Arduino.h>
#include "config.h"
#include "network.h"
#include "sensors.h"
#include "web_server.h"
SondeConfig sondesConfig[NB_SONDES] = {
{ "T°C Ext", "maison/jardin/ext/temperature", 60000, 0.2f },
{ "T°C Serre", "maison/jardin/serre/temperature", 60000, 0.1f },
{ "T°C Sol", "maison/jardin/sol/temperature", 60000, 0.1f },
};
SondeEtat sondesEtat[NB_SONDES] = {};
PointHistorique historique[HIST_TAILLE] = {};
uint16_t histIdx = 0;
NetworkStatus netStatus = {};
void setup() {
Serial.begin(115200);
Serial.println("[BOOT] esp_jardin démarrage...");
network_init();
sensors_init();
web_server_init();
}
void loop() {
network_update();
bool nouvelleMesure = sensors_update();
if (nouvelleMesure) {
web_server_notify_clients();
}
}