From ff878f8ef61c3019db33ec44c983059a178210f1 Mon Sep 17 00:00:00 2001 From: Tobias Blum Date: Sun, 29 Jan 2017 14:55:36 +0100 Subject: [PATCH] LEDs now show all green when in AP setup mode. --- Arduino/McLighting/McLighting.ino | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Arduino/McLighting/McLighting.ino b/Arduino/McLighting/McLighting.ino index 757149d..6ff1286 100644 --- a/Arduino/McLighting/McLighting.ino +++ b/Arduino/McLighting/McLighting.ino @@ -73,6 +73,12 @@ void configModeCallback (WiFiManager *myWiFiManager) { DBG_OUTPUT_PORT.println(myWiFiManager->getConfigPortalSSID()); //entered config mode, make led toggle faster ticker.attach(0.2, tick); + + uint16_t i; + for (i = 0; i < strip.numPixels(); i++) { + strip.setPixelColor(i, 0, 255, 0); + } + strip.show(); } @@ -105,6 +111,13 @@ void setup() { // start ticker with 0.5 because we start in AP mode and try to connect ticker.attach(0.6, tick); + // *************************************************************************** + // Setup: Neopixel + // *************************************************************************** + strip.begin(); + strip.setBrightness(brightness); + strip.show(); // Initialize all pixels to 'off' + // *************************************************************************** // Setup: WiFiManager // *************************************************************************** @@ -134,14 +147,6 @@ void setup() { digitalWrite(BUILTIN_LED, LOW); - // *************************************************************************** - // Setup: Neopixel - // *************************************************************************** - strip.begin(); - strip.setBrightness(brightness); - strip.show(); // Initialize all pixels to 'off' - - // *************************************************************************** // Setup: MDNS responder // ***************************************************************************