Datasheet
Advanced Coding
FastLED Library
If looking to boost your NeoPixel prowess, you may find everything you need in the FastLED library. It’s an alternative
to the Adafruit_NeoPixel library, providing more advanced features like HSV color support, nondestructive brightness
setting and high-speed mathematical operations. (It works with other LED types too, such as DotStars!)
FastLED works altogether differently; it’s not a drop-in replacement for Adafruit_NeoPixel, and existing sketches will
require some rewriting.
Note: FastLED currently works only with RGB NeoPixels; RGBW pixels are not yet supported. At all. You will get
incorrect and unpredictable colors.
We don’t write or maintain FastLED, and can’t provide software troubleshooting advice.
If requesting help with a
FastLED NeoPixel project in the forums, we’ll usually ask that you try one of the known-working Adafruit_NeoPixel
example sketches to narrow down whether it’s a hardware or software issue.
Visit the FastLED web site to get started.
FAQ and Further Programming Insights
Help! My Arduino servo code stops working when combined with NeoPixels!
Unfortunately the NeoPixel and Servo libraries don’t play nice together; one is dependent on periodically disabling
interrupts, the other absolutely requires interrupts. There are a couple of options here:
Use a dedicated servo control shield or breakout board, offloading that task from the processor so interrupts
are a non-issue.
Use a hardware-PWM-based servo library rather than the stock Arduino Servo library. This can provide rock-
steady servo timing without interrupts, but can only control a very limited number of servos (2-3), and only on
very specific pins.
When driving NeoPixels I cannot receive infrared codes on my IR receiver!
Just like servos, the infrared library uses software interrupts to poll the IR LED, while the standard NeoPixel library
blocks interrupts while NeoPixel are being updated.
If you don't constantly update the NeoPixel, IR will work in between updates, but if you update them all the time, you
will need to use another library and a microcontroller more capable than an Uno or Mega. Ideally one with DMA so
that NeoPixels don't take up any CPU cycles.
Marc MERLIN explains how to this depending on what chip you have (Teensy, ESP8266 or ESP32):
http://marc.merlins.org/perso/arduino/post_2017-04-03_Arduino-328P-Uno-Teensy3_1-ESP8266-ESP32-IR-and-
Neopixels.html
How fast can I refresh a string of (N) pixels?
NeoPixels receive data from a fixed-frequency 800 KHz datastream (except for “V1” Flora pixels, which use 400
KHz). Each bit of data therefore requires 1/800,000 sec — 1.25 microseconds. One pixel requires 24 bits (8 bits each
for red, green blue) — 30 microseconds. After the last pixel’s worth of data is issued, the stream must stop for at
least 50 microseconds for the new colors to “latch.”
For a strip of 100 pixels, that’s (100 * 30) + 50, or 3,050 microseconds. 1,000,000 / 3,050 = 328 updates per second,
© Adafruit Industries https://learn.adafruit.com/adafruit-neopixel-uberguide Page 56 of 68