Can I make the brightness darker?

Hello
Brightness level 0 ~ 15 cannot be set. (Black screen)
I need something darker.
Because in the bedroom it’s too bright at night.
(I am using with esp32)

I’m not sure why brightness <15 doesn’t work. Try setting the brightness of the layers lower in addition to the global brightness.

I understood.
Thank you :slight_smile:

I looked into this, and the way brightness is set on the ESP32, there are low brightness values where it round down to zero brightness. I wouldn’t say it’s a bug, just a side effect of how brightness is controlled.

Thanks Louis!

I did it according to the advice
Below is my code for brightness adjustment
It works exactly

Color list
NO R G B
0: {0, 0, 0}
1: {64, 0, 0}
2: {0, 64, 0}
3: {64, 64, 0}
4: {0, 0, 64}
5: {64, 0, 64}
6: {0, 64, 64}
7: {64, 64, 64}
8: {16, 16, 32}
9: {16, 16, 64}
10:{16, 32, 16}
11:{16, 32, 32}
12:{16, 32, 64}
13:{16, 64, 16}
14:{16, 64, 32}
15:{16, 64, 64}
16:{32, 16, 16}
17:{32, 16, 32}
18:{32, 16, 64}
19:{32, 32, 16}
20:{32, 32, 32}
21:{32, 32, 64}
22:{32, 64, 16}
23:{32, 64, 32}
24:{32, 64, 64}
25:{64, 16, 16}
26:{64, 16, 32}
27:{64, 16, 64}
28:{64, 32, 16}
29:{64, 32, 32}
30:{64, 32, 64}
31:{64, 64, 16}
32:{64, 64, 32}

void brightadj(){
uint8_t r,g,b;

if(LED == 0 || LED == 2 || LED == 4 || LED == 6)r = 0;
if(LED > 7 && LED < 16)r = 8;
if(LED > 15 && LED < 25)r = 16;
if(LED == 1 || LED == 3 || LED ==5 || LED == 7)r = 32;
if(LED > 24 && LED < 33)r = 32;

if(LED == 0  || LED==1  || LED == 4  || LED == 5) g = 0;
if(LED == 8  || LED==9  || LED == 16 || LED == 17 || LED == 18 || LED == 25 || LED ==26 || LED == 27)g = 8;
if(LED == 10 || LED==11 || LED == 12 || LED == 19 || LED == 20 || LED == 21 || LED ==28 || LED == 29 || LED == 30)g = 16;
if(LED == 2  || LED==3  || LED == 6  || LED == 7  || LED == 13 || LED == 14 || LED ==15 || LED == 22 || LED == 23 || LED == 24 || LED == 31 || LED == 32)g = 32;

if(LED == 0  || LED==1  || LED == 2  || LED == 3)b =0;
if(LED == 10 || LED==13 || LED == 16 || LED == 19 || LED == 22 || LED == 25 || LED==28 || LED == 31)b = 8;
if(LED == 8  || LED==11 || LED == 14 || LED == 17 || LED == 20 || LED == 23 || LED==26 || LED == 29 || LED == 32)b = 16;
if(LED == 4  || LED==5  || LED == 6  || LED == 7  || LED == 9  || LED == 12 || LED==15 || LED == 18 || LED == 21 || LED == 24 || LED == 27 || LED == 30)b = 32;

float f1 = setbright * 100; //setbright range=15~255 by CDS
f1 = f1 / 3180;
if(f1 < 1)f1 = 1;
float f2 = f1 * r;
if(f2 > 255)f2 = 255;
r = f2;
f2 = f1 * g;
if(f2 > 255)f2 = 255;
g = f2;
f2 = f1 * b;
if(f2 > 255)f2 = 255;
b = f2;

backgroundLayer.drawString(ledx, ledy, {r, g, b}, CL0, LEDCHAR);

}

You can do this without writing extra code using backgroundLayer.setBrightness(brightness);

See the FeatureDemo example