Skip to content

Instantly share code, notes, and snippets.

@srmq
Created December 1, 2019 17:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srmq/f09d0c69602aac9c96f3bbaedeedd4c5 to your computer and use it in GitHub Desktop.
Save srmq/f09d0c69602aac9c96f3bbaedeedd4c5 to your computer and use it in GitHub Desktop.
Main file of the Intelligent Irrigator, available under the GPL v3+
#include <ArduinoJson.h>
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <cmath>
#include "sensor_calibration.h"
#include "SensorTask.h"
#include "ServerTask.h"
#include "CloudTask.h"
#include "WiFiTask.h"
#include <Scheduler.h>
#include <WiFiUdp.h>
#include <NTPClient.h>
#include "FS.h"
#include <TimeLib.h>
#include <Time.h>
bool fsOpen = false;
void loop() {
Serial.println(F("WARNING: loop() was called"));
}
void setup() {
Serial.begin(115200);
delay(1000);
fsOpen = SPIFFS.begin();
static SensorTask sensorTask;
static ServerTask serverTask;
static WiFiTask wiFiTask;
static CloudTask cloudTask;
Scheduler.start(&sensorTask);
Scheduler.start(&serverTask);
Scheduler.start(&wiFiTask);
Scheduler.start(&cloudTask);
Serial.println(F("SETUP"));
Scheduler.begin();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment