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 113 of file Pacifica.ino.

114{
115 uint16_t ci = cistart;
116 uint16_t waveangle = ioff;
117 uint16_t wavescale_half = (wavescale / 2) + 20;
118 for( uint16_t i = 0; i < NUM_LEDS; i++) {
119 waveangle += 250;
120 uint16_t s16 = sin16( waveangle ) + 32768;
121 uint16_t cs = scale16( s16 , wavescale_half ) + wavescale_half;
122 ci += cs;
123 uint16_t sindex16 = sin16( ci) + 32768;
124 uint8_t sindex8 = scale16( sindex16, 240);
125 CRGB c = ColorFromPalette( p, sindex8, bri, LINEARBLEND);
126 leds[i] += c;
127 }
128}
CRGB leds[NUM_LEDS]
Definition Apa102.ino:11
#define NUM_LEDS
Definition Apa102.ino:6
@ 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
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:54

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

Referenced by pacifica_loop().

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