From ef90dba7377a26234c68d71d7ce7cc847969a6af Mon Sep 17 00:00:00 2001 From: starcalc Date: Mon, 27 Feb 2017 18:13:08 +0100 Subject: [PATCH] Show progress for OTA via Neopixels --- esp-wemos-schild/esp-wemos-schild.ino | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/esp-wemos-schild/esp-wemos-schild.ino b/esp-wemos-schild/esp-wemos-schild.ino index 3d8ff89..b5a2676 100644 --- a/esp-wemos-schild/esp-wemos-schild.ino +++ b/esp-wemos-schild/esp-wemos-schild.ino @@ -151,6 +151,16 @@ void setup() { ArduinoOTA.setHostname(Homie.getConfiguration().deviceId); ArduinoOTA.setPassword((const char *)"ctdo2342"); + ArduinoOTA.onStart([]() { + pixels.clear(); + }); + ArduinoOTA.onEnd([]() { + pixels.clear(); + }); + ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) { + pixels.setPixelColor(progress / (total / NUMPIXELS), pixels.Color(255, 255, 255)); + pixels.show(); + }); ArduinoOTA.begin(); }