I try to fill a ledstrip of 60 leds with 1 color and change the brightness
I do it this way
1.
int t = map(Spectrum[0],0,1024,0,255);
fill_solid(leds,NUM_LEDS,CHSV(255,255,t));
FastLED.delay(2);
2.
int t = map(Spectrum[0],0,1024,0,255);
fill_solid(leds,NUM_LEDS,RED);
FastLED.setBrightness(t);
FastLED.delay(2);
but by doing this, both ways, it only doesn't change the brightness, but also the colors. It is not only red, but also blue, ...
when I try
for (int u=0;u>255;u++){
fill_solid(leds,NUM_LEDS,RED);
FastLED.setBrightness(u);
FastLED.delay(2);
}
it changes the brightness and leave the color to red.
Why isn't it working the first way?
I really can't find the solution
Resha:
I try to fill a ledstrip of 60 leds with 1 color and change the brightness
I do it this way
1.
int t = map(Spectrum[0],0,1024,0,255);
fill_solid(leds,NUM_LEDS,CHSV(255,255,t));
FastLED.delay(2);
...
but by doing this, both ways, it only doesn't change the brightness, but also the colors. It is not only red, but also blue, ...
...
Why isn't it working the first way?
It's because 'pure red' in the HSV color system is 0 and not 255. The color number 255 is mostly red with a small amount of blue in it. In lower brightness only pure red appears, in higher brigthness a small amout of 1, 2 or 3 blue will be mixed into.
For a pure red only you'd better try:
int t = map(Spectrum[0],0,1024,0,255);
fill_solid(leds,NUM_LEDS,CHSV(0,255,t));
FastLED.delay(2);
Or use RGB color system instead of HSV color system, if you want control the pure R, G and B colors.