smoother transition

This commit is contained in:
Alessandro Mauri 2024-11-09 12:15:42 +01:00
parent ae854e8de1
commit 3efc3b1974

View file

@ -171,8 +171,8 @@ fn int main()
{|
int brightness_now = read_int(ACTUAL_BRIGHTNESS_DEV) ?? brightness_adjusted;
if (brightness_now == brightness_adjusted) { return; }
int step = (brightness_adjusted-brightness_now)/(SMOOTH_SAMPLES-1);
for (int i; i < SMOOTH_SAMPLES-1; i++) {
int step = (brightness_adjusted-brightness_now)/(SMOOTH_SAMPLES);
for (int i; i < SMOOTH_SAMPLES; i++) {
write_brightness(brightness_now + step*i);
thread::sleep_ms(SMOOTH_DURATION/SMOOTH_SAMPLES);
}