MCPcopy Create free account
hub / github.com/Blueforcer/awtrix3 / Pacifica

Function Pacifica

src/effects.cpp:6–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4CRGB tempLeds[32][8];
5
6void Pacifica(FastLED_NeoMatrix *matrix, int16_t x, int16_t y, EffectSettings *settings)
7{
8 static uint32_t sPacificaTime = 0;
9 sPacificaTime += settings->speed;
10 for (uint16_t i = 0; i < 32; i++)
11 {
12 for (uint16_t j = 0; j < 8; j++)
13 {
14 uint16_t ulx, uly;
15 ulx = (sPacificaTime / 8) - (i * 16);
16 uly = (sPacificaTime / 4) + (j * 16);
17 uint16_t v = 0;
18 v += sin16(ulx * 6 + sPacificaTime / 2) / 8 + 127;
19 v += sin16(uly * 9 + sPacificaTime / 2) / 8 + 127;
20 v += sin16(ulx * 7 + uly * 2 - sPacificaTime) / 16;
21 v = v / 3;
22 CRGB color = ColorFromPalette(settings->palette, v, 255, settings->blend ? LINEARBLEND : NOBLEND);
23 matrix->drawPixel(x + i, y + j, color);
24 }
25 }
26}
27
28void TheaterChase(FastLED_NeoMatrix *matrix, int16_t x, int16_t y, EffectSettings *settings)
29{

Callers

nothing calls this directly

Calls 1

drawPixelMethod · 0.80

Tested by

no test coverage detected