Show progress for OTA via Neopixels

This commit is contained in:
starcalc 2017-02-27 18:13:08 +01:00
parent c2e34b4688
commit ef90dba737
1 changed files with 10 additions and 0 deletions

View File

@ -151,6 +151,16 @@ void setup() {
ArduinoOTA.setHostname(Homie.getConfiguration().deviceId); ArduinoOTA.setHostname(Homie.getConfiguration().deviceId);
ArduinoOTA.setPassword((const char *)"ctdo2342"); 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(); ArduinoOTA.begin();
} }