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

◆ pacifica_one_layer()

void pacifica_one_layer ( CRGBPalette16 & p,
uint16_t cistart,
uint16_t wavescale,
uint8_t bri,
uint16_t ioff )
Examples
Pacifica.ino.

Definition at line 123 of file Pacifica.ino.

124{
125 uint16_t ci = cistart;
126 uint16_t waveangle = ioff;
127 uint16_t wavescale_half = (wavescale / 2) + 20;
128 for( uint16_t i = 0; i < NUM_LEDS; i++) {
129 waveangle += 250;
130 uint16_t s16 = sin16( waveangle ) + 32768;
131 uint16_t cs = scale16( s16 , wavescale_half ) + wavescale_half;
132 ci += cs;
133 uint16_t sindex16 = sin16( ci) + 32768;
134 uint8_t sindex8 = scale16( sindex16, 240);
135 CRGB c = ColorFromPalette( p, sindex8, bri, LINEARBLEND);
136 leds[i] += c;
137 }
138}
CRGB leds[NUM_LEDS]
#define NUM_LEDS
CRGB ColorFromPalette(const CRGBPalette16 &pal, fl::u8 index, fl::u8 brightness, TBlendType blendType)
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:551
#define sin16
Platform-independent alias of the fast sin implementation.
Definition trig8.h:112
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:86

References ColorFromPalette(), leds, NUM_LEDS, scale16(), and sin16.

Referenced by pacifica_loop().

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