FastLED 3.9.15
Loading...
Searching...
No Matches
fx Directory Reference
+ Directory dependency graph for fx:

Directories

 1d
 
 2d
 
 detail
 
 video
 

Files

 frame.cpp
 
 frame.h
 
 fx.h
 
 fx1d.h
 
 fx2d.h
 
 fx_engine.cpp
 
 fx_engine.h
 
 time.cpp
 
 time.h
 
 video.cpp
 
 video.h
 

Detailed Description

The FX library adds optional, higher‑level visual effects and a small runtime around FastLED. It includes ready‑to‑use animations for strips (1D) and matrices (2D), utilities to layer/up‑scale/blend effects, and a simple video playback pipeline.

If you’re new to FastLED and C++: an effect is an object that you construct once and call draw(...) on every frame, passing time and your LED buffer. Start with the 1D/2D examples, then explore composition and video as needed.

What’s included

Core concepts and types

Basic usage (1D example)

#include "fx/1d/cylon.h"
fl::Cylon fx(num_leds);
...
fx.draw(fl::Fx::DrawContext(millis(), leds));
CRGB leds[NUM_LEDS]
An animation that moves a single LED back and forth (Larson Scanner effect)
Definition cylon.h:13
_DrawContext DrawContext
Definition fx.h:21

Basic usage (2D example)

fl::XYMap xy(width, height, /* your mapper */);
...
fx.draw(fl::Fx::DrawContext(millis(), leds));
unsigned int xy(unsigned int x, unsigned int y)
Demonstrates how to mix noise generation with color palettes on a 2D LED matrix.

Composition and transitions

Video playback

Performance and targets

Licensing

Explore each subfolder’s README to find the effect you want, then copy the corresponding header into your project and call draw(...) every frame.

Examples (from examples/Fx*)

Minimal 1D call pattern:

fx.draw(fl::Fx::DrawContext(millis(), leds));
FastLED.show();
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
Definition FastLED.cpp:74

Minimal 2D call pattern (requires XYMap):

fx.draw(fl::Fx::DrawContext(millis(), leds));
FastLED.show();
fl::XYMap xyMap
Definition ColorBoost.h:61