fixed stoage issues with display brightnes
This commit is contained in:
parent
67cf4bad19
commit
6a3e161e5c
1 changed files with 7 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
// ------------------
|
||||
|
|
Loading…
Reference in a new issue