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

◆ pacifica_add_whitecaps()

void fl::Pacifica::pacifica_add_whitecaps ( CRGB * leds)
private

Definition at line 110 of file pacifica.h.

110 {
111 uint8_t basethreshold = beatsin8(9, 55, 65);
112 uint8_t wave = beat8(7);
113
114 for (uint16_t i = 0; i < mNumLeds; i++) {
115 uint8_t threshold = scale8(sin8(wave), 20) + basethreshold;
116 wave += 7;
117 uint8_t l = leds[i].getAverageLight();
118 if (l > threshold) {
119 uint8_t overage = l - threshold;
120 uint8_t overage2 = qadd8(overage, overage);
121 leds[i] += CRGB(overage, overage2, qadd8(overage2, overage2));
122 }
123 }
124}
CRGB leds[NUM_LEDS]
Definition Apa102.ino:11
uint16_t mNumLeds
Definition fx.h:50
LIB8STATIC uint8_t beat8(accum88 beats_per_minute, uint32_t timebase=0)
Generates an 8-bit "sawtooth" wave at a given BPM.
Definition lib8tion.h:923
LIB8STATIC uint8_t beatsin8(accum88 beats_per_minute, uint8_t lowest=0, uint8_t highest=255, uint32_t timebase=0, uint8_t phase_offset=0)
Generates an 8-bit sine wave at a given BPM that oscillates within a given range.
Definition lib8tion.h:975
LIB8STATIC_ALWAYS_INLINE uint8_t qadd8(uint8_t i, uint8_t j)
Add one byte to another, saturating at 0xFF.
Definition math8.h:31
LIB8STATIC_ALWAYS_INLINE uint8_t scale8(uint8_t i, fract8 scale)
Scale one byte by a second one, which is treated as the numerator of a fraction whose denominator is ...
Definition scale8.h:34
#define sin8
Platform-independent alias of the fast sin implementation.
Definition trig8.h:216
FASTLED_FORCE_INLINE uint8_t getAverageLight() const
Get the average of the R, G, and B values.
Definition crgb.hpp:163

References beat8(), beatsin8(), leds, fl::Fx::mNumLeds, qadd8(), scale8(), and sin8.

+ Here is the call graph for this function: