FastLED 3.9.15
Loading...
Searching...
No Matches

◆ pacifica_one_layer()

void fl::Pacifica::pacifica_one_layer ( CRGB * leds,
CRGBPalette16 & p,
uint16_t cistart,
uint16_t wavescale,
uint8_t bri,
uint16_t ioff )
private

Definition at line 90 of file pacifica.h.

92 {
93 uint16_t ci = cistart;
94 uint16_t waveangle = ioff;
95 uint16_t wavescale_half = (wavescale / 2) + 20;
96 for (uint16_t i = 0; i < mNumLeds; i++) {
97 waveangle += 250;
98 uint16_t s16 = sin16(waveangle) + 32768;
99 uint16_t cs = scale16(s16, wavescale_half) + wavescale_half;
100 ci += cs;
101 uint16_t sindex16 = sin16(ci) + 32768;
102 uint8_t sindex8 = scale16(sindex16, 240);
103 CRGB c = ColorFromPalette(p, sindex8, bri, LINEARBLEND);
104 leds[i] += c;
105 }
106}
CRGB leds[NUM_LEDS]
Definition Apa102.ino:11
uint16_t mNumLeds
Definition fx.h:50
@ LINEARBLEND
Linear interpolation between palette entries, with wrap-around from end to the beginning again.
CRGB ColorFromPalette(const CRGBPalette16 &pal, uint8_t index, uint8_t brightness, TBlendType blendType)
Get a color from a palette.
LIB8STATIC uint16_t scale16(uint16_t i, fract16 scale)
Scale a 16-bit unsigned value by an 16-bit value, which is treated as the numerator of a fraction who...
Definition scale8.h:540
#define sin16
Platform-independent alias of the fast sin implementation.
Definition trig8.h:98
static FASTLED_NAMESPACE_BEGIN uint8_t const p[]
Definition noise.cpp:56

References ColorFromPalette(), leds, LINEARBLEND, fl::Fx::mNumLeds, p, scale16(), and sin16.

Referenced by draw().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: