Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Multi_WS2811 mbed MMA8451Q
Fork of WS2811 by
Diff: WS2811.cpp
- Revision:
- 14:c97261a9a282
- Parent:
- 13:1f65330abe92
- Child:
- 16:5f75ea93f15d
diff -r 1f65330abe92 -r c97261a9a282 WS2811.cpp
--- a/WS2811.cpp Tue Jul 23 22:32:14 2013 +0000
+++ b/WS2811.cpp Sun Jul 28 08:38:18 2013 +0000
@@ -15,7 +15,8 @@
clk(clockPin) {
// Allocate 3 bytes per pixel:
numLEDs = n;
- if ((pixels = (uint8_t *)malloc(numLEDs * 3))) {
+ pixels = (uint8_t *)malloc(numLEDs * 3);
+ if (pixels) {
memset(pixels, 0x00, numLEDs * 3); // Init to RGB 'off' state
}
// calibrate delay loops for NRZ

Generic WS2811/WS2812