Added NTPClient and fixed that "random time delay" bug by applying pull request #62 https://github.com/arduino-libraries/NTPClient/pull/62. Also improved randomness by using the returned data from the NTP server to seed the RNG.

This commit is contained in:
2019-05-25 23:48:55 +02:00
parent 22b45d3342
commit 78f0ab5991
4 changed files with 280 additions and 11 deletions

View File

@ -5,9 +5,9 @@
#define FASTLED_INTERNAL
#include "FastLED.h"
#include <NTPClient.h>
#include <PubSubClient.h>
#include "SimpleList.h"
#include "ntp.h"
#include "config.h"
CRGB leds[LED_COUNT];
@ -98,7 +98,7 @@ void setup() {
wifi_setup();
ota_setup();
fastled_setup();
ntp_setup();
ntpClient.begin();
mqtt_setup();
Serial.println("Core * Setup complete");
}
@ -128,7 +128,7 @@ void loop() {
return;
}
ntp_loop();
ntpClient.update();
mqtt_loop();
EVERY_N_MILLISECONDS(1000 / FPS) {