fixed stoage issues with display brightnes

This commit is contained in:
Dorian Zedler 2020-10-18 22:48:29 +02:00
parent 67cf4bad19
commit 6a3e161e5c
Signed by: dorian
GPG key ID: D3B255CB8BC7CD37

View file

@ -6,6 +6,7 @@
void LedDisplayController::loop() void LedDisplayController::loop()
{ {
//Serial.printf("Ligth: %d \n" , analogRead(36));
if (this->disp_show) if (this->disp_show)
{ {
disp_start_set(); disp_start_set();
@ -56,7 +57,12 @@ bool LedDisplayController::setBrightness(int brightness)
{ {
if (brightness < 0 || brightness > 255) if (brightness < 0 || brightness > 255)
return false; return false;
this->text_sets.disp_brightness = brightness; 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; return true;
} }
@ -68,6 +74,7 @@ bool LedDisplayController::getAutomaticBrightnessAdjustment()
void LedDisplayController::setAutomaticBrightnessAdjustment(bool automaticBrightnessAdjustment) void LedDisplayController::setAutomaticBrightnessAdjustment(bool automaticBrightnessAdjustment)
{ {
this->text_sets.disp_automatic_brightness_adjustment = automaticBrightnessAdjustment; this->text_sets.disp_automatic_brightness_adjustment = automaticBrightnessAdjustment;
this->storeTextSets();
} }
// ------------------ // ------------------