# FastLED: driving WS2812B strips from Arduino and ESP32 without writing your own bit-bang timing

> FastLED is the MIT-licensed C++ LED animation library for Arduino, ESP32, Teensy and 50+ other platforms. It hides chipset timing behind a templated addLeds call, and the trade-off is that its platform matrix is much wider than its documentation.

**FastLED/FastLED** — The FastLED library for colored LED animation on Arduino. Please direct questions/requests for help to the FastLED Reddit community: We'd like to use github "issues" just for tracking library bugs / enhancements.

- Repository: https://github.com/FastLED/FastLED
- Website: http://fastled.io
- Stars: 7,497 · Forks: 1,758
- Language: C++
- License: MIT
- Published: 2026-08-08 · Updated: 2026-08-18 · Language: en
- Canonical page: https://hysenlabs.com/projects/fastled-fastled

## What FastLED solves for people writing LED firmware

Addressable LED chipsets such as WS2812B encode colour as a pulse-width-modulated serial stream with tolerances measured in hundreds of nanoseconds. Getting that right by hand means writing cycle-counted assembly or abusing a SPI peripheral, and then redoing it for every chipset and every clock speed. FastLED replaces that with a template: you name the chipset and the data pin, hand it a buffer, and the library selects the platform-specific output routine. The README states the library works on "Arduino, ESP32, Teensy, Raspberry Pi, and 50+ other platforms" and supports "nearly every LED chipset".

The audience is embedded developers, not end users. You need a C++ toolchain and a board. The README claims the library runs on "$0.50 ATtiny chips" with a footprint under 2KB on an Arduino Uno, which is the reason it appears in projects where a Raspberry Pi would be too expensive or too power hungry. The other end of that range is the claim of "30,000+ LEDs" on high-end devices and "50 parallel strips on Teensy". Those two numbers describe the same API on very different hardware, and that spread is the library's actual selling point.

## The mechanism: templated addLeds and a CRGB frame buffer

The unit of work in FastLED is a plain array of CRGB values that you own. You allocate it, the library writes bytes into it through whatever effect code you write, and FastLED.show() pushes the whole buffer out to the strip. Nothing is double-buffered unless you do it yourself, so the buffer size is a direct memory cost: NUM_LEDS multiplied by three bytes.

FastLED.addLeds is a template, and the chipset and pin are compile-time parameters. That is what lets the library pick a different output backend per platform without a runtime dispatch cost, and it is also why an unsupported pin or chipset combination fails at compile time rather than at runtime. The README's own example uses WS2812 on pin 6, which is the canonical case.

The README also describes "background rendering" on ESP32 and Teensy, where the library renders while your code continues, and an async task system positioned as an alternative to delay(). Those two features target the same failure mode: a sketch that blocks during FastLED.show() cannot read a button or service a network request. On AVR there is no such escape hatch, because the CPU has no second core to hand the work to.

## Installing the FastLED library in Arduino and a first WS2812B sketch

The README points to the Arduino Library Manager route and the repository ships a cookbook directory for tutorials. In the Arduino IDE, open the library manager, search for FastLED, and install it. The README's quick-start example is the shortest path to a working strip, and it is reproduced here with the same chipset, pin and LED count:

```cpp
#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);
}
```

Wire the strip's data line to pin 6 and its ground to the board's ground, and supply the strip from a separate 5V source sized for 60 LEDs at full white. If the first LED blinks red then blue at one-second intervals, the output path works. If nothing happens, the pin number is the first thing to change, since addLeds is templated on it.

For a non-Arduino build, the repository carries a CMakeLists.txt and a docker directory, and the pyproject.toml pins a build tool named fbuild at version 2.5.23 with a comment block explaining the pin. That file is CI infrastructure rather than a user-facing installer, and the README does not present it as the recommended path for application developers.

## Where FastLED is the wrong choice

FastLED is a library, so it has no web interface, no configuration file and no runtime discovery. If you want a lighting installation that someone can control from a phone, you are looking for a firmware application built on top of a library like this one, not for FastLED itself.

The second limitation is memory. The README says the library runs under 2KB on an Arduino Uno, but that figure describes the library, not your frame buffer. Sixty LEDs cost 180 bytes; a thousand LEDs cost 3KB, which already exceeds the Uno's RAM before any effect state. The README's own note that ATtiny4313 has "limited memory (WS2812 Blink + APA102 examples only)" is the same constraint stated plainly.

The third is timing portability. The per-board build badges in the README are the authoritative status per board, and the README explicitly warns that "a per-board badge can therefore be red while the smoke badge is green". It also notes that ClearCore coverage is "a compile-only Blink build" that "does not claim hardware timing validation". A green badge, in other words, means the examples compile, not that your strip will be glitch-free on that board. Timing-sensitive chipsets on unusual clock speeds are exactly where that gap shows up.

## FastLED vs WLED and vs Adafruit NeoPixel

The comparison people actually search for is fastled vs wled, and the difference is categorical. WLED is a complete firmware you flash onto an ESP board; it exposes a network interface and you configure it. FastLED is a C++ library you include in a sketch you write. Choosing FastLED means you own the animation logic and the build; choosing WLED means you accept its feature set in exchange for not writing firmware.

The other comparison is fastled vs neopixel, meaning Adafruit's NeoPixel library. Both drive WS2812B from an Arduino with a similar shape: a pixel array, a show call. The difference in approach is scope. NeoPixel targets the chipsets Adafruit sells and keeps the API small. FastLED carries a template layer for platform and chipset selection, a colour type with named constants such as CRGB::Red, global brightness handling the README describes as "zero-cost", and a separate effects tree under src/fx with 1D and 2D effects plus video playback. If you want the smallest possible dependency for one strip, NeoPixel's narrower surface is easier to reason about. If you want the same code to move between an ATtiny and a Teensy 4.1, the template layer is the reason to pay for it.

## Maintenance, releases and the MIT licence

The repository is not archived. The last push was on 2026-06-16, which is the same date as the 3.10.4 release, so the most recent tagged version and the most recent commit coincide. The prior release, 3.10.3, is dated 2025-09-20 and its title mentions a "W2812 timing update" plus stm32F4 board support, which is a useful signal about where effort goes: chipset timing and platform coverage rather than new user-facing features.

Upgrade cost is the part to think about before you depend on it. The pyproject.toml comment block records a pin to fbuild 2.5.23 and explains why: version 2.5.22 introduced an unpack-time submodule check that broke five SAMD boards before a compiler ran, and 2.5.23 moved the core to Adafruit's board-index bundle with a pinned sha256. That is CI tooling, not the library, but it illustrates the maintenance surface. Changing the library version can change which boards build, and the README does not document a rollback procedure.

The licence is MIT, stated in the repository and in the LICENSE file. That permits commercial and closed-source use with the usual requirement to keep the copyright and permission notice. This is a description of the licence text, not legal advice; if your product embeds the library, have your own counsel read the file.

## Conclusion

Adopt FastLED if you are writing C++ firmware for a microcontroller and need one API across WS2812B, APA102 and the rest of the chipset list on Arduino, ESP32, Teensy or an ATtiny. Do not adopt it if you want a network-controllable lighting product with a browser UI, because that is WLED's job and FastLED is a library you compile into your own sketch. Before committing, verify three things on your own hardware: that your exact board appears in the per-board build badges, that your chipset and pin combination is one of the templates the README demonstrates, and that the memory budget on your MCU fits the frame buffer you plan to allocate. The README does not document rollback or a version pinning story beyond the release tags, so decide how you will hold a working version before you ship.

## FAQ

### What is FastLED?

FastLED is a C++ library for animating addressable LED strips on microcontrollers. The README describes it as working on Arduino, ESP32, Teensy, Raspberry Pi and 50+ other platforms, with support for nearly every LED chipset.

### How do I install the FastLED library in Arduino?

Install it through the Arduino Library Manager by searching for FastLED, then include the header in your sketch. The README's quick-start example uses #include <FastLED.h> followed by a CRGB array and a FastLED.addLeds call.

### What are some alternatives to FastLED?

Adafruit's NeoPixel library is the closest equivalent, with a smaller API aimed at the chipsets Adafruit sells. WLED is a different category: a complete firmware with a network interface rather than a library you compile into your own sketch.

### Can you provide an example of how to use FastLED with Arduino?

The README's example declares NUM_LEDS 60 and a CRGB array, calls FastLED.addLeds<WS2812, 6>(leds, NUM_LEDS) in setup, then sets leds[0] to CRGB::Red and CRGB::Blue with FastLED.show() between them.

### What does FastLED Clear do?

The README does not document a Clear function, so its behaviour cannot be confirmed from the available material. The repository does contain an examples/Blur and examples/Blur2d directory, but those are unrelated to clearing a frame.

### How does FastLED compare with the Adafruit NeoPixel library?

Both drive WS2812B strips from an Arduino with a pixel buffer and a show call. FastLED adds a template layer for chipset and platform selection plus an effects tree under src/fx, while NeoPixel keeps a narrower API aimed at Adafruit's own chipsets.

## Sources

- [Official documentation](http://fastled.io)
- [Official README](https://github.com/FastLED/FastLED#readme)
- [Project repository](https://github.com/FastLED/FastLED)
- [Release notes](https://github.com/FastLED/FastLED/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/fastled-fastled
