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

◆ loop()

void loop ( )

Definition at line 75 of file Wave2d.ino.

75 {
76 // Your code here
77 waveSim.setXCylindrical(xCyclical.value());
78 waveSim.setSpeed(slider);
79 waveSim.setDampening(dampening);
80 waveSim.setHalfDuplex(halfDuplex);
81 waveSim.setSuperSample(getSuperSample());
82 if (button) {
84 }
85
86
88 if (autoTrigger) {
90 }
91 }
92
93 waveSim.update();
94 for (int y = 0; y < HEIGHT; y++) {
95 for (int x = 0; x < WIDTH; x++) {
96 uint8_t value8 = waveSim.getu8(x, y);
97 uint32_t idx = xyMap.mapToIndex(x, y);
98 leds[idx] = CRGB(value8, value8, value8);
99 }
100 }
101 FastLED.show();
102}
CRGB leds[NUM_LEDS]
Definition Apa102.ino:11
#define WIDTH
Definition Blur2d.ino:9
#define HEIGHT
Definition Blur2d.ino:10
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
Definition FastLED.cpp:62
uint32_t x[NUM_LAYERS]
Definition Fire2023.ino:82
uint32_t y[NUM_LAYERS]
Definition Fire2023.ino:83
SuperSample getSuperSample()
Definition Wave2d.ino:49
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)
XYMap xyMap
Definition gfx.cpp:8
#define EVERY_N_MILLISECONDS(N)
Alias for EVERY_N_MILLIS.
Definition lib8tion.h:1341
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:55
UICheckbox autoTrigger("Auto Trigger", true)
UIButton button("Trigger")
UICheckbox xCyclical("X Is Cyclical", false)
void triggerRipple()
Definition wavefx.cpp:147

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

+ Here is the call graph for this function: