Fix frontlight

This commit is contained in:
Djuri 2024-06-07 15:18:34 +02:00
parent 82e80f66e2
commit 32e40e2cb7
3 changed files with 20 additions and 18 deletions

View file

@ -338,11 +338,11 @@ void ledTheaterChaseRainbow(int wait) {
Adafruit_NeoPixel getPixels() { return pixels; }
#ifdef HAS_FRONTLIGHT
int flDelayTime = 10;
int flDelayTime = 5;
void frontlightFadeInAll() {
for (int dutyCycle = 0; dutyCycle <= preferences.getUInt("flMaxBrightness"); dutyCycle += 5) {
for (int ledPin = 0; ledPin < NUM_SCREENS; ledPin++) {
for (int ledPin = 0; ledPin <= NUM_SCREENS; ledPin++) {
flArray.setPWM(ledPin, 0, dutyCycle);
}
vTaskDelay(pdMS_TO_TICKS(flDelayTime));
@ -351,11 +351,13 @@ void frontlightFadeInAll() {
void frontlightFadeOutAll() {
for (int dutyCycle = preferences.getUInt("flMaxBrightness"); dutyCycle >= 0; dutyCycle -= 5) {
for (int ledPin = 0; ledPin < NUM_SCREENS; ledPin++) {
for (int ledPin = 0; ledPin <= NUM_SCREENS; ledPin++) {
flArray.setPWM(ledPin, 0, dutyCycle);
}
vTaskDelay(pdMS_TO_TICKS(flDelayTime));
}
flArray.allOFF();
}
void frontlightFadeIn(uint num) {