Hi Hans !
After many searches and tests this Saturday and Monday, here are the results.
First and overall it's quite successful with 3 LEDs
I played a lot with the settings to get very slow and smooth effects.
(Also with: EVERY_N_MILLIS(180) // do this only every x milliseconds)
On the other hand with 1 LED, the main problem are the blacks that I would like to be able to adjust. (As a general rule, I would like very little black between the color sequences).
LEDStatus[led].active = (random(60)<50);
Compared/Added function to "inactive" ?
Here are +/- the values used:
- 3 colors: CRGB(0xFF,0x66,0x66), CRGB(0xE6,0x17,0x17), CRGB(0x73,0x00,0x00)
#define MINSTEPSIZE 1 // We need to set a minimum stepsize, >0 !!
EVERY_N_MILLIS(180)
MINSTEPSIZE+random(8) // make fade out different from fade in speed
LEDStatus[led].active = (random(1000)<200);
LEDStatus[led].colorBase = palette[random(NUMCOLORS)];
LEDStatus[led].isFading = false;
LEDStatus[led].maxvalue = random(16,128);
LEDStatus[led].minvalue = 16;
LEDStatus[led].currentvalue = LEDStatus[led].minvalue;
LEDStatus[led].stepsize = MINSTEPSIZE+random(4);
I have a little trouble understanding the nesting of these commands:
- #define MINSTEPSIZE 1 // We need to set a minimum stepsize, >0 !!
- MINSTEPSIZE+random(8) // make fade out different from fade in speed
- LEDStatus[led].stepsize = MINSTEPSIZE+random(4);
About: "Serial message", I do not understand yet. Anyway here is what I found about "ATTiny85" = No Serial (UART). Yes SPI and I2C.
"You may notice, on the listing of special pin functions there are no UART RX’s or TX’s. That’s because the ATtiny85 doesn’t have a built in hardware UART. If you try to compile any Arduino code with Serial.begin(9600) ’s or Serial.print() ’s you’ll get an error".
I spent quite a bit of time looking for color references. We soon realize that RGB does not match !
With FastLED, it is therefore interesting to switch to HSV/HSB - "Rainbow" = Default FastLED = More evenly-spaced color bands (yellow).
I found a Color Converter that can give a first reference in 0-255 either "winHSL255".
I would also like to add (in addition to: LEDColorCorrection) a "Temperature correction" (White balance), for example useful for photo/video, or in a theater...
setTemperature (Halogen: 3200 Kelvin / HighNoonSun: 5400 Kelvin).
About the desired function (setValue), "setBrightness" vs "nscale8" (0-255) can only be used globally ?
For LEDs "WS2812B", should a more precise distinction be added, or "NEOPIXEL" (Neopixel - Aka the WS2811 or WS2812 or WS2812B) is sufficient ? + http://fastled.io/docs/3.1/class_w_s2812_controller800_khz.html
So much for today - hard to summarize.
I am waiting for your comments
Thank you in advance.
Guy-Laurent
PS: An idea/references about creating a Color palette - Programmable Color Palettes (CLUTs).