Datasheet
approximately.
However…
That’s
only
the time needed to
push the bits
down the wire. The
actual
refresh rate will be something less than this,
and can’t be estimated as a single number for all cases. It takes time to process each “frame” of animation. How
much time depends on the complexity of the math and the efficiency of the code (for example, floating-point
calculations can be relatively slow). The formula above gives a maximum
theoretical
rate, but that’s just a starting
point. Reality in some cases could fall an order of magnitude (or more) below this.
For exploratory benchmarking, you can always write code
as if
a large number of pixels were present, and time the
result. The extra output bits will simply be ignored by the strip (or you can even test with no NeoPixels connected at
all).
That won’t do. Now what?
Because NeoPixels use a fixed-frequency clock, options are limited. You can’t switch out for a faster microcontroller
and expect substantially different results.
One option is to use a different LED type, such as our DotStar or LPD8806 strips, or WS2801 pixels. These can be
driven at higher data rates, though they do have some other tradeoffs with respect to NeoPixels (cost, color
resolution and/or pixel density).
Another is to develop your own code on a more capable microcontroller or an FPGA that drives
multiple
NeoPixel
strips
in parallel
. One such project — OctoWS2811 for the Teensy 3 microcontroller — is shown later. This sort of
thing is a complex undertaking and not recommended for beginners. And even among more experienced
programmers, there’s often an unreasonable over-emphasis on data rates when the
real
bottlenecks lie elsewhere…
don’t dwell on this too much unless you can confirm it’s the root of the problem.
Can I control NeoPixels using (Board X)?
We currently only offer an Arduino library. See the links later for other devices. For anything beyond this, if
considering writing your own library, understand that some processors are better suited to the task than others.
Read through the timing requirements shown below and determine if the chip in question can synthesize a signal
meeting those specifications. An 8 MHz AVR can just barely keep up…anything slower may have trouble, though
some hardware-specific hacks (like clever use of SPI) might make it possible. In many cases, assembly language is
required.
Why not Raspberry Pi?
The Raspberry Pi running Linux is a multitasking system, and control may switch among multiple running programs
at any time. As such, it’s impossible to guarantee the strict 800 KHz signal required by NeoPixels. You may be able
to fudge it for short intervals, but it’s not something that can be counted upon. This is why we use DotStar LEDs for
the Raspberry Pi light painting project.
DMA NeoPixels for ARM Cortex-M0 Boards
If you’re using a recent “M0” development board such as the Adafruit Feather M0, Circuit Playground Express or
Arduino Zero, an alternate NeoPixel library exploits these devices’
direct memory access
(DMA) feature to operate
more smoothly. Advanced Arduino sketches can then use interrupts with impunity, and code that depends on the
millis() or micros() functions will not lose time.
There’s a corresponding DMA version of the NeoMatrix library as well.
© Adafruit Industries https://learn.adafruit.com/adafruit-neopixel-uberguide Page 57 of 68