Merge branch 'master' into 'master'

Show progress for OTA via Neopixels

See merge request !2
This commit is contained in:
dukat 2017-02-28 09:59:04 +01:00
commit 0fca0ea91d
1 changed files with 10 additions and 0 deletions

View File

@ -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(100, 0, 0));
pixels.show();
});
ArduinoOTA.begin();
}