Add one layer of waves into the led array
| 86 | |
| 87 | // Add one layer of waves into the led array |
| 88 | void Pacifica::pacifica_one_layer(fl::span<CRGB> leds, CRGBPalette16 &p, |
| 89 | u16 cistart, u16 wavescale, |
| 90 | u8 bri, u16 ioff) { |
| 91 | u16 ci = cistart; |
| 92 | u16 waveangle = ioff; |
| 93 | u16 wavescale_half = (wavescale / 2) + 20; |
| 94 | for (u16 i = 0; i < mNumLeds; i++) { |
| 95 | waveangle += 250; |
| 96 | u16 s16 = sin16(waveangle) + 32768; |
| 97 | u16 cs = scale16(s16, wavescale_half) + wavescale_half; |
| 98 | ci += cs; |
| 99 | u16 sindex16 = sin16(ci) + 32768; |
| 100 | u8 sindex8 = scale16(sindex16, 240); |
| 101 | CRGB c = ColorFromPalette(p, sindex8, bri, LINEARBLEND); |
| 102 | leds[i] += c; |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | // Add extra 'white' to areas where the four layers of light have lined up |
| 107 | // brightly |
nothing calls this directly
no test coverage detected