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

◆ loop()

void loop ( )

Definition at line 65 of file Wave.ino.

65 {
66 // Your code here
67 waveSim.setSpeed(slider);
68 waveSim.setDampening(dampening);
69 waveSim.setHalfDuplex(halfDuplex);
70 waveSim.setSuperSample(getSuperSample());
71 static int x = 0;
72 if (button.clicked()) {
73 x = random() % NUM_LEDS;
74 }
75 if (button.isPressed()) {
76 FASTLED_WARN("Button is pressed at " << x);
78 }
79 waveSim.update();
80 for (int i = 0; i < extraFrames.value(); i++) {
81 waveSim.update();
82 }
83 for (int x = 0; x < NUM_LEDS; x++) {
84 // float value = waveSim.get(x);
85 uint8_t value8 = waveSim.getu8(x);
86 leds[x] = CRGB(value8, value8, value8);
87 }
88 FastLED.show();
89}
CRGB leds[NUM_LEDS]
Definition Apa102.ino:11
#define NUM_LEDS
Definition Apa102.ino:6
CFastLED FastLED
Global LED strip management instance.
Definition FastLED.cpp:58
uint32_t x[NUM_LAYERS]
Definition Fire2023.ino:80
UIButton button("Trigger")
void triggerRipple()
Definition FxWave2d.ino:120
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)
SuperSample getSuperSample()
Definition Wave.ino:50
WaveSimulation1D waveSim(NUM_LEDS, SuperSample::SUPER_SAMPLE_2X)
UISlider extraFrames("Extra Frames", 1.0f, 0.0f, 8.0f, 1.0f)
Representation of an RGB pixel (Red, Green, Blue)
Definition crgb.h:54
#define FASTLED_WARN
Definition warn.h:7

References button, dampening, extraFrames, FastLED, FASTLED_WARN, getSuperSample(), halfDuplex, leds, NUM_LEDS, slider, triggerRipple(), waveSim, and x.

+ Here is the call graph for this function: