From 6a3e161e5c98ce4f7e66e813e5ec9098480cfddd Mon Sep 17 00:00:00 2001 From: Dorian Zedler Date: Sun, 18 Oct 2020 22:48:29 +0200 Subject: [PATCH] fixed stoage issues with display brightnes --- .../OmobiLEDdisplayBluetooth/src/LedDisplayController.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vscode/OmobiLEDdisplayBluetooth/src/LedDisplayController.cpp b/vscode/OmobiLEDdisplayBluetooth/src/LedDisplayController.cpp index fd6445b..ff7af9d 100644 --- a/vscode/OmobiLEDdisplayBluetooth/src/LedDisplayController.cpp +++ b/vscode/OmobiLEDdisplayBluetooth/src/LedDisplayController.cpp @@ -6,6 +6,7 @@ void LedDisplayController::loop() { + //Serial.printf("Ligth: %d \n" , analogRead(36)); if (this->disp_show) { disp_start_set(); @@ -56,7 +57,12 @@ bool LedDisplayController::setBrightness(int brightness) { if (brightness < 0 || brightness > 255) return false; + + this->text_sets.disp_brightness = brightness; + this->matrix->SetBrightness(pow (2, (this->text_sets.disp_brightness / RFade)) - 1); + this->matrix->Show(); + this->storeTextSets(); return true; } @@ -68,6 +74,7 @@ bool LedDisplayController::getAutomaticBrightnessAdjustment() void LedDisplayController::setAutomaticBrightnessAdjustment(bool automaticBrightnessAdjustment) { this->text_sets.disp_automatic_brightness_adjustment = automaticBrightnessAdjustment; + this->storeTextSets(); } // ------------------