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
1 changed files with 7 additions and 0 deletions

View File

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