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);
105 }
106}
@ 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...
#define sin16
Platform-independent alias of the fast sin implementation.
static FASTLED_NAMESPACE_BEGIN uint8_t const p[]