The speedMs setting (100-5000ms) in the Afterburner firmware now controls the animation timing for various LED effects, making it a functional and useful control parameter.
- Function: Controls how fast the afterburner effect pulses
- Formula:
pulseFrequency = 1000.0f / speedMs - Examples:
- 100ms = Very fast pulse (10Hz) - Rapid pulsing
- 1200ms = Medium pulse (0.83Hz) - Normal pulsing
- 5000ms = Slow pulse (0.2Hz) - Slow, gentle pulsing
- Function: Controls the breathing animation speed for the main LED strip
- Formula:
breathingSpeed = 1000.0f / speedMs - Effect: Creates a subtle breathing effect where brightness gently rises and falls
- Examples:
- 100ms = Rapid breathing - Very fast brightness changes
- 1200ms = Normal breathing - Comfortable breathing rate
- 5000ms = Slow breathing - Very slow, gentle breathing
- Function: Controls how fast the flicker animation cycles
- Formula:
flickerSpeed = 1000.0f / speedMs - Effect: Adds realistic flicker to simulate flame/engine effects
- Examples:
- 100ms = Fast flicker - Rapid, intense flickering
- 1200ms = Normal flicker - Realistic flicker rate
- 5000ms = Slow flicker - Gentle, slow flickering
- Function: Controls sparkle frequency during afterburner activation
- Formula:
sparkleFrequency = 1000.0f / speedMs - Effect: Adds white sparkles when afterburner is strong
- Examples:
- 100ms = Many sparkles - Dense sparkle effect
- 1200ms = Normal sparkles - Balanced sparkle density
- 5000ms = Few sparkles - Sparse, occasional sparkles
-
Pulse Mode (
led_effects.cpp:110):// Before (hardcoded): float pulse = 0.6f + 0.4f * sin(millis() * 0.12f); // After (speed-controlled): float pulseFrequency = 1000.0f / (float)settings.speedMs; float pulse = 0.6f + 0.4f * sin(millis() * pulseFrequency);
-
Breathing Effect (
led_effects.cpp:80-85):// New breathing effect for Ease and Pulse modes if (settings.mode == 1 || settings.mode == 2) { float breathingSpeed = 1000.0f / (float)settings.speedMs; float breathing = 0.8f + 0.2f * sin(millis() * breathingSpeed); baseBrightness = (uint8_t)(baseBrightness * breathing); }
-
Flicker Effect (
led_effects.cpp:150-155):// Before (hardcoded): uint8_t noise = inoise8(ledIndex * 12, (millis() + ledIndex * 7) * 8 + noiseOffset); // After (speed-controlled): float flickerSpeed = 1000.0f / (float)settings.speedMs; uint8_t noise = inoise8(ledIndex * 12, (millis() * flickerSpeed + ledIndex * 7) * 8 + noiseOffset);
-
Sparkle Effect (
led_effects.cpp:170-175):// Before (hardcoded): if (random(1000) < (abIntensity * 50)) { // After (speed-controlled): float sparkleFrequency = 1000.0f / (float)settings.speedMs; uint16_t sparkleChance = (uint16_t)(abIntensity * 50 * sparkleFrequency); if (random(1000) < sparkleChance) {
addFlicker()now takesconst AfterburnerSettings& settingsparameteraddSparkles()now takesconst AfterburnerSettings& settingsparameter- All function calls updated to pass the settings object
| Speed Setting | Animation Speed | User Experience |
|---|---|---|
| 100ms | Very Fast | Rapid, intense animations - Good for high-energy effects |
| 500ms | Fast | Quick animations - Good for dynamic effects |
| 1200ms | Normal | Default speed - Balanced, comfortable animations |
| 2500ms | Slow | Gentle animations - Good for relaxed effects |
| 5000ms | Very Slow | Very slow animations - Good for subtle, ambient effects |
- Mode 0 (Linear): No breathing effect, speed only affects flicker and sparkles
- Mode 1 (Ease): Breathing effect + speed-controlled flicker and sparkles
- Mode 2 (Pulse): Breathing effect + speed-controlled pulse, flicker, and sparkles
- User Control: Users can now customize animation speed to their preference
- Performance: Faster speeds for high-energy situations, slower for ambient use
- Consistency: All animation effects now use the same speed setting
- Realism: More realistic engine/flame effects with adjustable timing
- Flexibility: Different speeds work better in different lighting conditions
Potential improvements could include:
- Speed presets (Slow, Normal, Fast, Turbo)
- Speed ramping for smooth transitions
- Mode-specific speed ranges
- Speed synchronization with throttle input
- Speed-based color temperature changes
To verify the speed setting:
- Set different speed values via the mobile app (100ms to 5000ms)
- Observe changes in:
- Pulse mode afterburner pulsing rate
- Breathing effect speed
- Flicker animation speed
- Sparkle frequency during afterburner
- Verify that faster speeds create more rapid animations
- Verify that slower speeds create more gentle animations