Test program for my Multi_WS2811 library that started out as a fork of heroic/WS2811. My library uses hardware DMA on the FRDM-KL25Z to drive up to 16 strings of WS2811 or WS2812 LEDs in parallel.

Dependencies:   Multi_WS2811 mbed MMA8451Q

Fork of WS2811 by Heroic Robotics

NOTE: I have accidentally pushed changes for another fork of this program that I used in the recent Georgetown Carnival Power Tool Races. When I get some time, I will restore the test program to its original glory.

You can see my power tool racer (Nevermore's Revenge) here


This tests my FRDM-KL25Z multi-string WS2811/WS2812 library. It uses the accelerometer to change the rainbow phase on two strings of LEDs as well as the touch sense to change brightness.

A video of this program in operation is here.

Here is the library that I developed to run the LEDs:

Import libraryMulti_WS2811

Library allowing up to 16 strings of 60 WS2811 or WS2812 LEDs to be driven from a single FRDM-KL25Z board. Uses hardware DMA to do a full 800 KHz rate without much CPU burden.


RevisionDateWhoCommit message
40:d5c8ce80b6c4 2016-06-10 Ned Konz Added audio default tip
39:e735259e1d2e 2015-06-15 Ned Konz race version
38:3b1ce6902a1b 2015-06-13 Ned Konz Worked out flapping and color animation
37:e25d212ee3fe 2015-06-12 Ned Konz Dummy out wait_for_dma_done
36:9ee1ec2135d5 2015-06-12 Ned Konz Refactored self-test; getting wait_for_dma_done() to work
35:f177e1bf5ef7 2015-06-12 Ned Konz added .vimrc
34:cd56c00ed910 2015-06-12 Ned Konz fixed up IO; DMA not yet ending
33:43b504e417e3 2015-06-11 bikeNomad changed abs() to fabs() to fix offline compilation.
32:115032de785f 2015-06-11 bikeNomad changed to use template class
31:c9eee3a33826 2014-01-04 bikeNomad factored out Multi_WS2811 library.
30:52e9205a8059 2014-01-04 bikeNomad used TPM0 to time guard time at end of DMA.
29:a76075c853ee 2014-01-03 bikeNomad fixed bit timing to eliminate flickering.
28:dbe551a3dd64 2014-01-03 bikeNomad removed unnecessary color constructors
27:88c2abdf5eb9 2014-01-03 bikeNomad made rainbows change with accelerometer.
26:ac5d0e18c7b6 2014-01-02 bikeNomad adjusted timing from 420/840 nsec to 350/700 per datasheet
25:751c89f7e654 2014-01-02 bikeNomad added second light strip to demo.
24:feb1dae0403a 2014-01-02 bikeNomad added R/G/B test at start; 50usec guardtime doesn't work for some reason.
23:33df42ff2541 2014-01-02 bikeNomad smoothed animation; added frames/sec count (now at 341 for rainbow)
22:abfed71656bd 2014-01-02 bikeNomad Changed to 60 LEDs maximum. Reduced brightness.
21:4541da183397 2014-01-02 bikeNomad Got parallel mode working!
20:b9d76e567637 2013-12-21 bikeNomad still trying to get DMA to work
19:600deef36348 2013-12-06 bikeNomad added HSB/RGB conversions; removed unnecessary virtuals
18:d98353e8c61c 2013-12-05 bikeNomad renamed back to WS2811
17:b4e9d8f4baa9 2013-12-05 bikeNomad renamed ws2812.* to ws2811.*
16:5f75ea93f15d 2013-10-10 heroic Bump version, add register debug.
15:331e139672b5 2013-12-05 bikeNomad inlined bit writes
14:c97261a9a282 2013-07-28 heroic Cleanup.
13:1f65330abe92 2013-07-23 heroic Rework timing for constant execution time; do direct bitband writes for improved speed; change interrupt handling (turns out we can't have interrupts during an entire strip push, not just between bits).; ; Now works!
12:7ebd51549c04 2013-04-11 heroic Add function to write packed pixels via memcpy (about 150 usec faster)
11:d127f93be182 2013-02-20 heroic Fix timing on ws2811.
10:62368b801d16 2013-02-19 heroic Add ability to slow down ws2811 communications
9:dd524af149e6 2012-11-14 heroic Mask interrupts during critical section.
8:e3249c2b7607 2012-11-10 heroic Initial commit for first cut of WS2811 driver. These are one-wire style devices, so we do some timing mojo.
7:3025f0e0d70a 2012-10-12 heroic Add logic to compute total luminance and hence current.
6:7aebe547f0f0 2012-10-11 heroic Initial commit of WS2801 driver library.
5:70ded6500cd3 2012-10-10 heroic Remove dead comment
4:0b75eb84a6d2 2012-10-05 heroic Change to use virtual base class
3:a415f73507c9 2012-10-01 heroic Remove unnecessary function.
2:af5af64e114d 2012-09-16 heroic Add extra functions and parameterize; support software SPI.
1:6ebd3ac910b6 2011-12-16 ehbmbed2 Updated comments
0:12e734116fea 2011-12-16 ehbmbed2 first revision, works, needs to be tested on long strands