Skip to content

Commit

Permalink
Merge pull request #340 from socke7/brightness-fix
Browse files Browse the repository at this point in the history
fix calculation of automatic brightness control
  • Loading branch information
Blueforcer authored Oct 14, 2023
2 parents 7abf704 + f20eda3 commit 9a64d7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PeripheryManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ void PeripheryManager_::tick()
CURRENT_LUX = (roundf(photocell.getSmoothedLux() * 1000) / 1000);
if (AUTO_BRIGHTNESS && !MATRIX_OFF)
{
brightnessPercent = sampleAverage / 4095.0 * 100.0;
brightnessPercent = sampleAverage / 1023.0 * 100.0;
BRIGHTNESS = map(brightnessPercent, 0, 100, MIN_BRIGHTNESS, MAX_BRIGHTNESS);
DisplayManager.setBrightness(BRIGHTNESS);
}
Expand Down

0 comments on commit 9a64d7a

Please sign in to comment.