32 KiB
FastLED - The Universal LED Library
Transform any microcontroller into an LED powerhouse.
Drive 30,000+ LEDs on high-end devices • Sub-$1 compatibility on tiny chips • Background rendering for responsive apps • Nearly every LED chipset supported • #2 most popular Arduino library
⚡ Get Blinking in 30 Seconds
#include <FastLED.h>
#define NUM_LEDS 60
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<WS2812, 6>(leds, NUM_LEDS);
}
void loop() {
leds[0] = CRGB::Red; FastLED.show(); delay(500);
leds[0] = CRGB::Blue; FastLED.show(); delay(500);
}
✅ Works on Arduino, ESP32, Teensy, Raspberry Pi, and 50+ other platforms
🚀 Why FastLED?
| Massive Scale | Tiny Footprint | Background Rendering | Universal |
|---|---|---|---|
| Drive 30,000 LEDs on Teensy 4.1 | Runs on $0.50 ATtiny chips | ESP32/Teensy render while you code | Works on 50+ platforms |
| 50 parallel strips on Teensy | <2KB on Arduino Uno | Never miss user input | Nearly every LED chipset |
🎯 Performance: Zero-cost global brightness • High-performance 8-bit math, memory efficient on platforms that need it. 🔧 Developer Experience: Quick platform switching • Extensive examples • Active community support
Table of Contents
- 🆕 Latest Feature
- ⭐ Community Growth
- 🆕 Latest Features
- 🌍 Platform Support
- 📦 Installation
- 📚 Documentation & Support
- 🎮 Advanced Features
- 🤝 Contributing
📊 Detailed Build Status
Arduino Family
*Notes: * Giga-R1 support added in 3.9.14 • ** ATtiny4313 has limited memory (WS2812 Blink + APA102 examples only)
Teensy Series
NRF52 (Nordic)
*Note: NRF52 XiaoBLE board has mbed engine but doesn't compile against Arduino.h for unknown reasons.
Apollo3 (Ambiq)
*Beta support added in 3.10.2
STM32 (STMicroelectronics)
*Note: STM103TB has limited PlatformIO support
Silicon Labs (SiLabs)
*MGM240 (EFR32MG24) support for Arduino Nano Matter and SparkFun Thing Plus Matter boards
Raspberry Pi Pico
ESP32 (Espressif)
*Notes: * ESP32-C2 support added in 3.9.10 • Espressif compatibility evaluation
Specialty Platforms
Library Size Validation
⭐ Community Growth
🆕 Latest Features
FastLED 3.10.2: Corkscrew Mapping
See examples/FestivalStick/FestivalStick.ino
https://github.com/user-attachments/assets/19af4b54-c189-482b-b13b-2d7f73efa4e0
FastLED 3.10.0: Animartrix Out of Beta
Advanced animation framework for complex LED visualizations and effects.
FastLED 3.9.16: WaveFx / Multi Layer Compositing
Multi-layer compositing & time-based animation control for tech-artists.
https://github.com/user-attachments/assets/ff8e0432-3e0d-47cc-a444-82ce27f562af
| 3.9.13 | 3.9.10 | 3.9.8 | 3.9.2 |
|---|---|---|---|
| HD107 Turbo 40MHz LED support |
ESP32 SPI Super stable WS2812 driver |
Massive Teensy 50 parallel pins on 4.1 |
WS2812 Overclock Up to 70% speed boost |
| 3.7.7 | More Features |
|---|---|
| RGBW Support White channel LED strips |
📋 Full Changelog 📺 Demo Videos |
📺 Live Demos • 📋 Full Changelog
📖 Detailed Feature Information (Click to expand)
New in 3.10.2: Corkscrew Mapping
See examples/FestivalStick/FestivalStick.ino
https://github.com/user-attachments/assets/19af4b54-c189-482b-b13b-2d7f73efa4e0
New in 3.10.0: Animartrix out of beta
New in 3.9.16: WaveFx / Multi Layer Compositing / Time-based animation control
Video:
https://github.com/user-attachments/assets/ff8e0432-3e0d-47cc-a444-82ce27f562af
Major release for tech-artists!
Lots of improvements in this release, read the full change list here
Links
- This demo -> FxWave2d
- FireCylinder
- Wraps around so that (0,y) ~= (width-1,y)
- TimeAlpha
- Precision control of animations with time-based alpha transition.
New in 3.9.13: HD107 "Turbo" 40Mhz LED Support
New in 3.9.12: WS2816 "HD" LED support
New in 3.9.10: Super Stable WS2812 SPI driver for ESP32
New in 3.9.9: 16-way Yves I2S parallel driver for the ESP32-S3
*Note some users find that newer versions of the ESP32 Arduino core (3.10) don't work very well, but older versions do, see issue 1903
New in 3.9.8 - Massive Teensy 4.1 & 4.0 WS2812 LED output
- Teensy 4.1: 50 parallel pins
- Teensy 4.0: 42 parallel pins
New in 3.9.2 - Overclocking of WS2812
Update: max overclock has been reported at +70%: https://www.reddit.com/r/FastLED/comments/1gkcb6m/fastled_FASTLED_OVERCLOCK_17/
New in 3.7.7 - RGBW LED Strip Support
🌍 Platform Support
Platform Categories
| Arduino Family | ESP32 Series | Teensy | ARM | Specialty |
|---|---|---|---|---|
| Uno, Nano, Mega Due, Giga R1, R4 |
ESP32, S2, S3, C3 C6, H2, P4 |
3.0, 3.1, 4.0, 4.1 LC + OctoWS2811 |
STM32, NRF52 Apollo3, Silicon Labs |
Raspberry Pi WASM, x86 |
FastLED supports 50+ platforms! From sub-$1 ATtiny chips to high-end Teensy 4.1 with 50 parallel outputs.
📦 Installation
Quick Install Options
| Arduino IDE | PlatformIO | Package Managers |
|---|---|---|
| Library Manager → Search "FastLED" → Install | lib_deps = fastled/FastLED |
pio pkg install --library "fastled/FastLED" |
| Or install latest release .zip | Add to platformio.ini |
Command line installation |
Template Projects
- 🎯 Arduino + PlatformIO Starter - Best of both worlds, works with both IDEs
- 🚀 FastLED Examples - 100+ ready-to-run demos
- 🌐 Web Compiler - Test in your browser
Arduino IDE Setup Instructions (Click to expand)
After installing the Arduino IDE, add FastLED through the Library Manager:
📚 Documentation & Support
| 📖 Documentation | 💬 Community | 🐛 Issues | 📺 Examples |
|---|---|---|---|
| API Reference | Reddit r/FastLED | GitHub Issues | Live Demos |
| Doxygen Docs | 1000s of users & solutions | Bug reports & feature requests | GitHub Examples |
Need Help? Visit r/FastLED - thousands of knowledgeable users and extensive solution history!
🎮 Advanced Features
Performance Leaders: Parallel Output Records
| Platform | Max Parallel Outputs | Performance Notes |
|---|---|---|
| Teensy 4.1 | 50 parallel strips | Current record holder - Example |
| Teensy 4.0 | 42 parallel strips | High-performance ARM Cortex-M7 |
| ESP32DEV | 24 via I2S + 8 via RMT | I2S Example |
| ESP32-S3 | 16 via I2S + 4 via RMT | S3 Example |
Note: Some ESP32 Arduino core versions (3.10+) have compatibility issues. Older versions work better - see issue #1903
Exotic Setups (120+ Outputs!)
Custom shift register boards can achieve extreme parallel output:
- ESP32DEV: 120-output virtual driver
- ESP32-S3: 120-output S3 driver
Parallel WS2812 Drivers
FastLED supports several drivers for parallel WS2812 output.
Teensy
The following drivers are available for Teensy boards:
WS2812Serial driver
The WS2812Serial driver leverages serial ports for LED data transmission on Teensy boards.
Usage
To use this driver, you must define USE_WS2812SERIAL before including the FastLED header.
#define USE_WS2812SERIAL
#include <FastLED.h>
Then, use WS2812SERIAL as the chipset type in your addLeds call. The data pin is not used for this driver.
FastLED.addLeds<WS2812SERIAL, /* DATA_PIN */, GRB>(leds, NUM_LEDS);
Supported Pins & Serial Ports
| Port | Teensy LC | Teensy 3.2 | Teensy 3.5 | Teensy 3.6 | Teensy 4.0 | Teensy 4.1 |
|---|---|---|---|---|---|---|
| Serial1 | 1, 4, 5, 24 | 1, 5 | 1, 5, 26 | 1, 5, 26 | 1 | 1, 53 |
| Serial2 | 10, 31 | 10 | 10 | 8 | 8 | |
| Serial3 | 8 | 8 | 8 | 14 | 14 | |
| Serial4 | 32 | 32 | 17 | 17 | ||
| Serial5 | 33 | 33 | 20, 39 | 20, 47 | ||
| Serial6 | 48 | 24 | 24 | |||
| Serial7 | 29 | 29 | ||||
| Serial8 | 35 |
ObjectFLED Driver
The ObjectFLED driver is an advanced parallel output driver specifically optimized for Teensy 4.0 and 4.1 boards when using WS2812 LEDs. It is designed to provide high-performance, multi-pin output.
By default, FastLED automatically uses the ObjectFLED driver for WS2812 LEDs on Teensy 4.0/4.1 boards.
Disabling ObjectFLED (Reverting to Legacy Driver)
If you encounter compatibility issues or wish to use the standard clockless driver instead of ObjectFLED, you can disable it by defining FASTLED_NOT_USES_OBJECTFLED before including the FastLED header:
#define FASTLED_NOT_USES_OBJECTFLED
#include <FastLED.h>
Re-enabling ObjectFLED (Explicitly)
While ObjectFLED is the default for Teensy 4.0/4.1, you can explicitly enable it (though not strictly necessary) using:
#define FASTLED_USES_OBJECTFLED
#include <FastLED.h>
ESP32
The following drivers are available for ESP32 boards:
ESP32-S3 I2S Driver
The ESP32-S3 I2S driver leverages the I2S peripheral for high-performance parallel WS2812 output on ESP32-S3 boards. This driver is a dedicated clockless implementation.
Usage
To use this driver, you must define FASTLED_USES_ESP32S3_I2S before including the FastLED header.
#define FASTLED_USES_ESP32S3_I2S
#include <FastLED.h>
Then, use WS2812 as the chipset type in your addLeds call. The data pin will be configured by the I2S driver.
FastLED.addLeds<WS2812, DATA_PIN, GRB>(leds, NUM_LEDS);
Note: This driver requires a compatible Arduino-ESP32 core/IDF.
Generic ESP32 I2S Driver
The generic ESP32 I2S driver provides parallel WS2812 output for various ESP32 boards (e.g., ESP32-DevKitC). It uses the I2S peripheral for efficient data transmission.
Usage
To use this driver, you must define FASTLED_ESP32_I2S before including the FastLED header.
#define FASTLED_ESP32_I2S
#include <FastLED.h>
Then, use WS2812 as the chipset type in your addLeds call. The data pin will be configured by the I2S driver.
FastLED.addLeds<WS2812, DATA_PIN, GRB>(leds, NUM_LEDS);
DMA Buffer Configuration
For improved resilience under interrupt load (e.g., Wi-Fi activity), you can increase the number of I2S DMA buffers by defining FASTLED_ESP32_I2S_NUM_DMA_BUFFERS. A value of 4 is often recommended.
#define FASTLED_ESP32_I2S_NUM_DMA_BUFFERS 4
Note: All I2S lanes must share the same chipset/timings. If per-lane timing differs, consider using the RMT driver instead.
Supported LED Chipsets
FastLED supports virtually every LED chipset available:
| Clockless (3-wire) | SPI-based (4-wire) | Specialty |
|---|---|---|
| WS281x Family: WS2811, WS2812 (NeoPixel), WS2812-V5B, WS2815 | APA102 / DotStars: Including HD107s (40MHz turbo) | SmartMatrix Panels |
| TM180x Series: TM1809/4, TM1803 | High-Speed SPI: LPD8806, WS2801, SM16716 | DMX Output |
| Other 3-wire: UCS1903, GW6205, SM16824E | APA102HD: Driver-level gamma correction | P9813 Total Control |
RGBW Support: WS2816 and other white-channel LED strips • Overclocking: WS2812 up to 70% speed boost
More details: Chipset Reference Wiki
APA102 High Definition Mode
#define LED_TYPE APA102HD // Enables hardware gamma correction
void setup() {
FastLED.addLeds<LED_TYPE, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
}
Read more: APA102 HD Documentation • Rust Implementation
🛠️ Development & Contributing
Ready to contribute? FastLED welcomes code contributions, platform testing, documentation improvements, and community support.
🔧 Development Setup & Contributing Guide (Click to expand)
Quick Development Setup
Zero pain setup - can be done from command line in seconds with uv or python:
Steps:
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/yourusername/FastLED.git - Test compilation:
bash compile(select your target platform) - Make your changes and test
- Push to your fork and create a pull request
See our detailed Contributing Guide for more information.
Testing Other Devices
Use the compile script to test on 20+ platforms:
- Teensy series, ESP32 variants, Arduino family, ARM boards, and more
- Automated testing ensures compatibility across all supported platforms
How to Help
| 📋 How to Help | 🔗 Resources |
|---|---|
| Code contributions: Bug fixes, new features, optimizations | Contributing Guide |
| Platform support: Help test on new/existing platforms | Platform Testing |
| Documentation: Improve examples, fix typos, add tutorials | Documentation |
| Community: Answer questions on Reddit, report issues | r/FastLED |
Platform Porting: Information on porting FastLED to new platforms: PORTING.md
About FastLED
What's in the name? Originally "FastSPI_LED" focused on high-speed SPI, but evolved to support all LED types and became "FastLED" - everything fast, for LEDs.
Official Site: fastled.io - documentation, issues, and news
Daniel Garcia, Founder of FastLED
In Memory of Daniel Garcia Daniel Garcia, the brilliant founder of FastLED, tragically passed away in September 2019 in the Conception dive boat fire alongside his partner, Yulia. This heartbreaking loss was felt deeply by the maker and developer community, where Daniel's contributions had left an indelible mark.
Daniel was more than just a talented programmer; he was a passionate innovator who transformed the way creators interacted with LED technology. His work on FastLED brought high-performance LED control to countless projects, empowering developers to craft breathtaking installations.
In his personal life, Daniel was known for his kindness and creativity. His pride in FastLED and the vibrant community it fostered was a testament to his dedication to open-source development and his commitment to helping others bring light into the world.
While Daniel is no longer with us, his legacy continues through the FastLED library and the countless makers who use it. The community he built serves as a living tribute to his ingenuity, generosity, and the joy he found in sharing his work with the world.
About the Current Contributor
Zach Vorhies, the current main contributor to FastLED, briefly worked with Dan in 2014 in San Francisco and was an avid user of the FastLED library for over 13 years. After Daniel Garcia’s untimely passing, Zach stepped up to ensure FastLED’s continued growth and development.
Zach has this to say about FastLED:
"The true power of FastLED lies in its ability to transform programmers into LED artists. Free space becomes their canvas; bending light is their medium. FastLED is a collective effort by programmers who want to manifest the world that science fiction writers promised us. -- To contribute code to FastLED is to leave behind a piece of something immortal."
💫 In memory of Daniel Garcia and the vision that transforms programmers into LED artists
To stay updated on the latest feature releases, please click the Watch button in the upper right
""
