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

◆ loop()

void loop ( )

Definition at line 66 of file Wave2d.ino.

66 {
67 // Your code here
68 waveSim.setSpeed(slider);
69 waveSim.setDampening(dampening);
70 waveSim.setHalfDuplex(halfDuplex);
71 waveSim.setSuperSample(getSuperSample());
72 if (button) {
74 }
75
76
78 if (autoTrigger) {
80 }
81 }
82
83 waveSim.update();
84 for (int y = 0; y < HEIGHT; y++) {
85 for (int x = 0; x < WIDTH; x++) {
86 uint8_t value8 = waveSim.getu8(x, y);
87 uint32_t idx = xyMap.mapToIndex(x, y);
88 leds[idx] = CRGB(value8, value8, value8);
89 }
90 }
91 FastLED.show();
92}
CRGB leds[NUM_LEDS]
Definition Apa102.ino:11
#define WIDTH
Definition Blur2d.ino:9
#define HEIGHT
Definition Blur2d.ino:10
CFastLED FastLED
Global LED strip management instance.
Definition FastLED.cpp:58
uint32_t x[NUM_LAYERS]
Definition Fire2023.ino:80
uint32_t y[NUM_LAYERS]
Definition Fire2023.ino:81
XYMap xyMap(HEIGHT, WIDTH, SERPENTINE)
UICheckbox autoTrigger("Auto Trigger", true)
UIButton button("Trigger")
void triggerRipple()
Definition FxWave2d.ino:120
SuperSample getSuperSample()
Definition Wave2d.ino:45
UISlider slider("Speed", 0.18f, 0.0f, 1.0f)
UISlider dampening("Dampening", 6.0f, 0.0f, 10.0f, 0.1f)
UICheckbox halfDuplex("Half Duplex", false)
WaveSimulation1D waveSim(NUM_LEDS, SuperSample::SUPER_SAMPLE_2X)
#define EVERY_N_MILLISECONDS(N)
Alias for EVERY_N_MILLIS.
Definition lib8tion.h:1359
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:54

References autoTrigger, button, dampening, EVERY_N_MILLISECONDS, FastLED, getSuperSample(), halfDuplex, HEIGHT, leds, slider, triggerRipple(), waveSim, WIDTH, x, xyMap, and y.

+ Here is the call graph for this function: