Datasheet
WS2811? WS2812? Why do I see two different names mentioned?
The WS2811 is an earlier driver chip separate from the RGB LED. The data signal is similar, but
runs at half the speed. By the time the WS2812 (with integrated LED) was released, a lot of code
and projects had already built up around the WS2811 name. Sometimes code “for the WS2811”
might actually be for the newer chip, or for either type. The Adafruit_NeoPixel library supports
both.
Writing Your Own Library
The WS2812 datasheet (http://adafru.it/cDB) explains the data transmission protocol. This is a self-
clocking signal — there’s only one wire, not separate data and clock lines. “1” and “0” bits are
indicated by varying the duty cycle of a fixed-frequency square wave.
There’s a math goof in the datasheet’s timing values. Use these figures instead:
Note that there’s nearly 25% “wiggle room” in the timing. So if your code can’t match the
recommended times exactly, it’s usually okay.
There are three bytes of data for each pixel. These should be issued in green, red, blue order, with
the most-significant bit first.
The data for pixel #0 (nearest the microcontroller) is issued first, then pixel #1, and so forth to the
© Adafruit Industries https://learn.adafruit.com/adafruit-neopixel-uberguide Page 38 of 39