|
FastLED 3.9.15
|
Directory dependency graph for examples:This document maps the example sketches, shows how to run them on different targets (Arduino/PlatformIO, Teensy, ESP32, WASM), and suggests learning paths. It mirrors the structure and tone of src/fl/README.md so you can quickly jump between concepts and runnable code.
The examples/ directory contains runnable sketches that cover:
Typical first steps:
NUM_LEDS, chipset, and DATA_PIN to match hardware.ino file directly (e.g., examples/Blink/Blink.ino)FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS)NUM_LEDSFastLED.setBrightness(…)Tips:
WIDTH/HEIGHT and confirm wiring (serpentine vs. linear)platformio.ini that targets your MCU and copy an example sketch into a project src/ foldersrc/platforms/stub/meson.build and run uv run test.py --cpp)examples/SpecialDrivers/Teensy/OctoWS2811/* and related Teensy demos show multi-output patternsexamples/SpecialDrivers/ESP/ for ESP32 special driver examples:DriverTest/ - Tests all available LED drivers for your ESP32 variant (RMT, SPI, I2S, PARLIO, UART, LCD_RGB)examples/wasm/ and related WASM-focused examples run in the browsersrc/platforms/wasm and src/fl/ui/ui.h)This list highlights commonly used examples. It is not exhaustive—browse the folders for more.
Blink/ — minimal starting pointFirstLight/ — walk a single bright pixel along the stripPinMode/ — simple input pin usageRGBSetDemo/ — basic pixel addressing and assignmentRGBCalibrate/ — adjust color channel balanceColorPalette/ — palette usage and transitionsColorTemperature/ — white point and temperature helpersHSVTest/ — HSV types and conversionsColorBoost/ — saturation/luminance shaping for high visual impactCylon/, FxCylon/ — scanning eye; FX variants use higher-level helpersFire2012/, Fire2012WithPalette/, FxFire2012/ — classic fire effectTwinkleFox/, FxTwinkleFox/ — twinkling star fieldsPride2015/, FxPride2015/ — rainbow variantsDemoReel100/, FxDemoReel100/ — rotating showcase of many patternsWave/ — 1D wave toolkitXYMatrix/ — matrix mapping helpers and layoutsWave2d/, FxWave2d/ — 2D wavefieldsBlur2d/ — separable blur across a matrixDownscale/ — render high-res, resample to panel resolutionAnimartrix/ — animated matrix patterns and helpersSmartMatrix/ — SmartMatrix integration sketchFxEngine/ — scaffolding for composing layers and framesFxGfx2Video/ — utilities to pipe graphics into frame/video helpersfx/ under src/ provides the building blocks used by these examplesAudio/ — audio input + analysis (simple and advanced variants)AudioInput/ — I2S microphone input (ESP32 & Teensy, INMP441 compatible)Ports/PJRCSpectrumAnalyzer/ — Teensy-centric spectrum analyzerFxSdCard/ — SD-backed media and assets (see data/ subfolder)Multiple/ — organize multiple arrays/segmentsTeensyParallel/ — multi-output exampleSpecialDrivers/ for platform-specific high-performance drivers (ESP, Teensy, Adafruit)SpecialDrivers/ESP/DriverTest/ for ESP32 driver testing (tests RMT, SPI, I2S, PARLIO, UART, LCD_RGB based on your variant)SpecialDrivers/Teensy/ for Teensy parallel drivers (OctoWS2811, ObjectFLED)SmartMatrix/ — run on SmartMatrix hardwarewasm/ — browser-targeted demoWasmScreenCoords/ — UI overlay and coordinate visualizationJson/ — JSON-structured sketch exampleUITest/ — showcase of JSON UI controls and groupsLuminescentGrand/ — complex, multi-file installation pieceLuminova/ — larger effect setChromancer/ — advanced example with assets and helpersFastLED now supports flexible @filter directives in .ino sketch files for conditional compilation based on platform, memory, target, and board properties. This enables you to maintain platform-specific examples without duplicating code.
One-liner format (compact, flexible):
Multi-line YAML format (explicit):
Operators:
is / is not - Exact match (supports wildcards with *)= / : - Shorthand for ismatches - Regex/glob pattern matchProperty shortcuts:
mem → memoryplat → platformtgt → targetbrd → boardLogical operators: and, or
Memory tiers (ordered: low < large < huge):
(memory is large) — matches large AND huge boards(memory is huge) — matches only huge boards (ESP32, Teensy 4.x, RP2040, native)(memory is low) — matches all boards (every board is >= low)Examples:
NUM_LEDS to match your hardware:FastLED.addLeds<CHIPSET, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS);WS2812B, SK6812, APA102 (APA102 also needs CLK_PIN)FastLED.setBrightness(…) and consider power limits for dense stripsWIDTH/HEIGHT and use serpentine or row-major helpers; verify orientationfl::Leds + XYMap for 2D logic when the example exposes those hooksdownscaleBlink → FirstLight → DemoReel100ColorPalette and ColorTemperatureCylon, Fire2012, TwinkleFoxXYMatrix, then try Downscale or Wave2dOctoWS2811Demo, TeensyParallelwasm, UITest, JsonCorkscrew (in src/fl), Fx* examples, and ChromancerDATA_PIN, chipset, and COLOR_ORDERNUM_LEDS and power are correct; try a low brightness firstGRB vs. RGB ordering; some strips invert green/redWIDTH and HEIGHTFastLED.h, pick your chipset, set NUM_LEDS, and get something simple running firstfill_rainbow and CHSVsrc/fl/ and src/fx/fl:: containers, views (fl::span), and graphics helpers for portability and qualitysrc/fl/ui/ui.h) and WASM bridge (src/platforms/wasm)This README will evolve alongside the examples. Browse subfolders for sketch-specific notes and hardware details. For the core library map and deeper subsystems, see src/README.md and src/fl/README.md.