diff --git a/esp32/src/main.cpp b/esp32/src/main.cpp index 65a756e..92de5f3 100644 --- a/esp32/src/main.cpp +++ b/esp32/src/main.cpp @@ -220,6 +220,7 @@ bool updateMap() { Serial.println("Reconnected!"); } else { Serial.println("Reconnecting failed."); + ESP.restart(); return false; } } @@ -302,8 +303,6 @@ uint16_t ambientBrightnessToPower() { sum += rolling_average_brightness[i]; } uint16_t brightness = sum / (sizeof(rolling_average_brightness)/sizeof(uint16_t)); - Serial.print("brightness: "); - Serial.println(brightness); if (brightness > spiffs_config.brightness_thresh_lower + 40 && leds_on_hysteresis) { Serial.println("LED power off!"); leds_on_hysteresis = false; @@ -346,7 +345,7 @@ void loop() { pixels.setPixelColor(i, pixels.Color(power, 0, 0)); // closed -> red break; case SpaceState::Open: - pixels.setPixelColor(i, pixels.Color(0, power, power/8)); // open -> green + pixels.setPixelColor(i, pixels.Color(0, power, 0)); // open -> green break; case SpaceState::Invalid: pixels.setPixelColor(i, pixels.Color(power, power/2, 0)); // invalid response -> orange