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

◆ processAutoTrigger()

void processAutoTrigger ( uint32_t now)

Definition at line 234 of file FxWave2d.ino.

234 {
235 static uint32_t nextTrigger = 0;
236 uint32_t trigger_delta = nextTrigger - now;
237 if (trigger_delta > 10000) {
238 // rolled over!
239 trigger_delta = 0;
240 }
241 if (autoTrigger) {
242 if (now >= nextTrigger) {
244 float speed = 1.0f - triggerSpeed.value();
245 uint32_t min_rand = 400 * speed;
246 uint32_t max_rand = 2000 * speed;
247
248 uint32_t min = MIN(min_rand, max_rand);
249 uint32_t max = MAX(min_rand, max_rand);
250 if (min == max) {
251 max += 1;
252 }
253 nextTrigger = now + random(min, max);
254 }
255 }
256}
UISlider speed("Speed", 1.0f, -20.0f, 20.0f, 0.01f)
UICheckbox autoTrigger("Auto Trigger", true)
UISlider triggerSpeed("Trigger Speed",.5f, 0.0f, 1.0f, 0.01f)
void triggerRipple()
Definition FxWave2d.ino:127
#define MIN(a, b)
Definition math_macros.h:15
#define MAX(a, b)
Definition math_macros.h:11

References autoTrigger, MAX, MIN, speed, triggerRipple(), and triggerSpeed.

Referenced by loop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: