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

◆ update()

void NoiseVariantManager::update ( uint32_t now,
bool auto_cycle_enabled,
uint8_t manual_variant,
const PlasmaParams & params )
inline

Definition at line 431 of file FxNoiseRing.h.

431 {
432 plasma_params = params;
433
434 // Handle automatic cycling vs manual override
435 if (auto_cycle_enabled) {
436 EVERY_N_MILLISECONDS(12000) { // Slightly longer for each variant
437 startTransition((current_variant + 1) % 10, now); // ALL 10 variants
438 }
439 } else if (manual_variant != target_variant && transition_progress >= 1.0f) {
440 // Manual override
441 startTransition(manual_variant, now);
442 }
443
444 // Update transition progress
445 if (transition_progress < 1.0f) {
446 uint32_t elapsed = now - transition_start;
447 transition_progress = min(1.0f, elapsed / (float)TRANSITION_DURATION);
448
449 if (transition_progress >= 1.0f) {
451 }
452 }
453 }
PlasmaParams plasma_params
void startTransition(uint8_t new_variant, uint32_t now)
static const uint32_t TRANSITION_DURATION
uint32_t transition_start
#define EVERY_N_MILLISECONDS(N)
Alias for EVERY_N_MILLIS.
Definition lib8tion.h:1221

References current_variant, EVERY_N_MILLISECONDS, plasma_params, startTransition(), target_variant, TRANSITION_DURATION, transition_progress, and transition_start.

+ Here is the call graph for this function: