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

◆ pacifica_add_whitecaps()

void pacifica_add_whitecaps ( )
Examples
Pacifica.ino.

Definition at line 144 of file Pacifica.ino.

145{
146 uint8_t basethreshold = beatsin8( 9, 55, 65);
147 uint8_t wave = beat8( 7 );
148
149 for( uint16_t i = 0; i < NUM_LEDS; i++) {
150 uint8_t threshold = scale8( sin8( wave), 20) + basethreshold;
151 wave += 7;
152 uint8_t l = leds[i].getAverageLight();
153 if( l > threshold) {
154 uint8_t overage = l - threshold;
155 uint8_t overage2 = qadd8( overage, overage);
156 leds[i] += fl::CRGB( overage, overage2, qadd8( overage2, overage2));
157 }
158 }
159}
#define NUM_LEDS
fl::CRGB leds[NUM_LEDS]
LIB8STATIC u8 beatsin8(accum88 beats_per_minute, u8 lowest=0, u8 highest=255, u32 timebase=0, u8 phase_offset=0) FL_NOEXCEPT
Generates an 8-bit sine wave at a given BPM that oscillates within a given range.
Definition beat.h:105
LIB8STATIC u8 beat8(accum88 beats_per_minute, u32 timebase=0) FL_NOEXCEPT
Generates an 8-bit "sawtooth" wave at a given BPM.
Definition beat.h:51
fl::CRGB CRGB
Definition video.h:15
unsigned char uint8_t
Definition s16x16x4.h:209

References beat8(), beatsin8(), leds, and NUM_LEDS.

Referenced by fl::Pacifica::draw(), and pacifica_loop().

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