MCPcopy Create free account
hub / github.com/FastLED/FastLED / processWaveAutoTrigger

Function processWaveAutoTrigger

examples/FestivalStick/curr.h:682–701  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

680}
681
682void processWaveAutoTrigger(uint32_t now) {
683 // Handle automatic wave triggering
684 if (waveAutoTrigger.value()) {
685 if (now >= nextWaveTrigger) {
686 triggerWaveRipple();
687
688 // Calculate next trigger time based on speed
689 float speed = 1.0f - waveTriggerSpeed.value();
690 uint32_t min_interval = (uint32_t)(500 * speed); // Minimum 500ms * speed
691 uint32_t max_interval = (uint32_t)(3000 * speed); // Maximum 3000ms * speed
692
693 // Ensure valid range
694 uint32_t min = fl::min(min_interval, max_interval);
695 uint32_t max = fl::max(min_interval, max_interval);
696 if (min >= max) max = min + 1;
697
698 nextWaveTrigger = now + random16(min, max);
699 }
700 }
701}
702
703
704

Callers 1

drawWaveFunction · 0.85

Calls 3

triggerWaveRippleFunction · 0.85
maxFunction · 0.85
valueMethod · 0.45

Tested by

no test coverage detected