From a22a059ac3fcce465378e7e3e036dfd414c7c641 Mon Sep 17 00:00:00 2001 From: "Ansgar [Hiajen]" Date: Tue, 8 Mar 2022 16:40:08 +0100 Subject: [PATCH] add prediction and stuff --- src/Weather.c.ino | 221 +++++++++++++++++++++++++++++++++++--------- src/proj_password.h | 3 - 2 files changed, 175 insertions(+), 49 deletions(-) delete mode 100644 src/proj_password.h diff --git a/src/Weather.c.ino b/src/Weather.c.ino index 731b857..63ceadc 100644 --- a/src/Weather.c.ino +++ b/src/Weather.c.ino @@ -4,27 +4,39 @@ #include #include "DHT.h" #include +#include -#include "proj_password.h" +#include "proj_conf.h" -#define LED 2 //On board LED +#define LED 2 // On board LED #define DHTTYPE DHT22 // DHT 11 -uint8_t DHTPin = 12; -DHT dht(DHTPin, DHTTYPE); +uint8_t DHTPin = 12; +DHT dht(DHTPin, DHTTYPE); + +const char *ntpServer = "pool.ntp.org"; +const long gmtOffset_sec = 3600; // Replace with your GMT offset (seconds) +const int daylightOffset_sec = 0; // Replace with your daylight offset (seconds) + +// Generally, you should use "unsigned long" for variables that hold time +// The value will quickly become too large for an int to store +unsigned long previousMillis = 0; +// constants won't change : +float time_till_update = 10; // define device I2C address: 0x76 or 0x77 (0x77 is library default address) -#define BMP280_I2C_ADDRESS 0x76 +#define BMP280_I2C_ADDRESS 0x76 // initialize Adafruit BMP280 library -Adafruit_BMP280 bmp280; +Adafruit_BMP280 bmp280; float humidity, temperature, temperature_2, pressure; -ESP8266WebServer server(80); //Server on port 80 +int currZambretti = 26; +ESP8266WebServer server(80); // Server on port 80 const char MAIN_page[] PROGMEM = R"=====( Weather -

Some Weather ....

+

Some Weather

NodeMCU Data Logger