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(); } // ------------------