FastLED 3.9.15
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages

◆ mapWaveToLEDs()

void fl::WaveCrgbMapDefault::mapWaveToLEDs ( const XYMap & xymap,
WaveSimulation2D & waveSim,
CRGB * leds )
inlineoverridevirtual

Implements fl::WaveCrgbMap.

Definition at line 34 of file wave.h.

35 {
36 const uint32_t width = waveSim.getWidth();
37 const uint32_t height = waveSim.getHeight();
38 for (uint32_t y = 0; y < height; y++) {
39 for (uint32_t x = 0; x < width; x++) {
40 uint32_t idx = xymap(x, y);
41 uint8_t value8 = waveSim.getu8(x, y);
42 leds[idx] = CRGB(value8, value8, value8);
43 }
44 }
45 }
CRGB leds[NUM_LEDS]
Definition Apa102.ino:11
int y
Definition Audio.ino:72
int x
Definition Audio.ino:71
XYMap xymap(WIDTH, HEIGHT, SERPENTINE)
WaveSimulation1D waveSim(NUM_LEDS, SuperSample::SUPER_SAMPLE_2X)

References leds, waveSim, x, xymap, and y.