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

◆ processWaveAutoTrigger()

void processWaveAutoTrigger ( uint32_t now)

Definition at line 682 of file curr.h.

682 {
683 // Handle automatic wave triggering
684 if (waveAutoTrigger.value()) {
685 if (now >= nextWaveTrigger) {
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
699 }
700 }
701}
FL_DISABLE_WARNING_PUSH U constexpr common_type_t< T, U > min(T a, U b) FL_NOEXCEPT
Memory functions are available in fl:: namespace via fl/stl/cstring.h Using declarations cannot work ...
Definition math.h:71
constexpr common_type_t< T, U > max(T a, U b) FL_NOEXCEPT
Definition math.h:75
uint16_t speed
Definition Noise.ino:66
fl::UISlider waveTriggerSpeed("Wave Trigger Speed", 0.5f, 0.0f, 1.0f, 0.01f)
void triggerWaveRipple()
Definition curr.h:658
static uint32_t nextWaveTrigger
Definition curr.h:254
fl::UICheckbox waveAutoTrigger("Wave Auto Trigger", true)
LIB8STATIC fl::u16 random16() FL_NOEXCEPT
Generate a 16-bit random number.
Definition random8.h:63
FL_DISABLE_WARNING_PUSH U constexpr common_type_t< T, U > min(T a, U b) FL_NOEXCEPT
Definition math.h:71
constexpr common_type_t< T, U > max(T a, U b) FL_NOEXCEPT
Definition math.h:75
fl::u32 uint32_t
Definition s16x16x4.h:219

References fl::max(), max(), fl::min(), min(), nextWaveTrigger, random16(), speed, triggerWaveRipple(), waveAutoTrigger(), and waveTriggerSpeed().

Referenced by drawWave().

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