Thanks, sorry, my old age is showing… so the two methods above are not good or not useful, which is why I can’t find simple examples of where they’re used, right?
Then, with your recent suggestion you linked to, the only reliable way to 1. get the brightness of a leds array element and then 2. check if it is above/below a certain value and 3. then set an appropriate state flag and darken/brighten/donothing is:
#define DARKEST_COLOUR CRGB(32,32,32) #define BRIGHTEST_COLOUR CRGB(240,240,240) #define DARKEN_LED CRGB(32,32,32) #define BRIGHTEN_LED CRGB(16,16,16)
… CHSV currentBrightness = rgb2hsv_approximate(leds[i]);
…
for ( byte i = 0; i < ledCount; i++) {
if ( ledState[i] == ledConstant) {
if ( random8() < 11) {
ledState[i] = ledBrightens;
}
Thanks; how close were your results? I have only a box of Pro Trinkets at my disposal in my retreat, so no serial output for me : (
I tried the method above to convert the only 3 brightness related lines of code (79, 89, 90) in @Mark_Kriegsman example https://gist.github.com/kriegsman/88954aae22b03a664081 that shimmers just perfect; but in my case, many LEDs just randomly get to zero or blink. I suspect the
CHSV currentHSV = rgb2hsv_approximate(leds[i]);
to get at the brightness, like he does with BASE_COLOR and PEAK_COLOR, which he hard-coded, does not work when your LED strip is constantly filled from a gradient palette.
Did you try setting BASE_COLOR to whatever color you’re grabbing from the gradient palette?
Change BASE_COLOR from a #define to something like this:
CRGB BASE_COLOR = CRGB(200,64,200);
so you can update it whenever you need to.
Also, you should really consider getting one of ANY other controller that can actually use the serial monitor. It would make things much easier to debug and be able to see what’s going on. Once you have your code all sorted out and don’t need the serial monitor anymore, then you can upload it to that board.
(I bought exactly one of those cute little boards and then never another because not being able to use the serial monitor is a pain!)
to fill all 144 LEDs with the interpolated colour from the gradient palette over one hour, later to be several hours.
Trouble is, if I now want to have all 144 LEDs shimmer as in https://gist.github.com/kriegsman/88954aae22b03a664081 then I need to set a status flag when PEAK_COLOR or BASE_COLOR is reached. But those are not known from the interpolated palette, or I am at a loss how to find them.
I thought I somehow need to make the if… else… checking independent from hard-coded PEAK and BASE colours, in order to apply the shimmer so nicely demonstrated in that sketch. I already tried to modify the many remotely similar examples I saw, but they are either rhythmic or not granular or they just flicker nervously, instead of shimmering very slowly.
I have been at this for over two weeks now, also taking that HSV detour, but not came no further…