You are reading a single comment by @DrAzzy and its replies. Click here to read the full conversation.
  • The "twinkle" effect sets the contents of leds.t, a signed int8 array.... I don't see how it could be done with a table though:

    There are two twinkle modes (so far) - the basic random twinkle - each channel of each LED has a chance (from 1/16 to 16/16, depending on high nybble of the mode for that channel of that LED in leds.tm) to change by 1 (plus or minus) within the range set by leds.ta and leds.ti.

    At high chances of change, and lowish brightness, you can get an effect reminiscent of flickering candle flames. At higher brightnesses and/or lower chances of change, the changes are less visible, but you can have all of the LEDs, or groups of the LEDs set to the same color, but with twinkle on, so they're not each exactly the same color - which is a key goal.

    The other mode is simple fade back and forth of the twinkle brightness between the minimum and maximum brightnesses.

    All of these are per channel not per LED.
    At the end, the twinkle, base, and animation overlay are added together to get the output buffer. Then flip takes that buffer, and uses the gtab lookup table and the other logic there to take advantage of the global dimming to get a less horribly non-linear relationship between the number for the color, and what you see.

About

Avatar for DrAzzy @DrAzzy started