control multi animation ledws2812 by usb serial com
Dependencies: PixelArray WS2812 mbed
Fork of WS2812_Example by
Revision 1:e04a0ecefa29, committed 2015-02-12
- Comitter:
- bridadan
- Date:
- Thu Feb 12 20:20:54 2015 +0000
- Parent:
- 0:12cb6f0c2788
- Child:
- 2:cb82a3dc4031
- Commit message:
- Removed platform dependent code from library. Cleaned up code
Changed in this revision
| WS2812.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/WS2812.lib Thu Feb 12 19:20:00 2015 +0000 +++ b/WS2812.lib Thu Feb 12 20:20:54 2015 +0000 @@ -1,1 +1,1 @@ -http://developer.mbed.org/users/bridadan/code/WS2812/#0b79cafcb387 +http://developer.mbed.org/users/bridadan/code/WS2812/#aadbf08c62a2
--- a/main.cpp Thu Feb 12 19:20:00 2015 +0000
+++ b/main.cpp Thu Feb 12 20:20:54 2015 +0000
@@ -4,15 +4,18 @@
#define WS2812_BUF 60
-WS2812 ws(D9,WS2812_BUF);
PixelArray px(WS2812_BUF);
+// See the program page for information on the timing numbers (eg: 0, 5, 5, 0)
+// The given numbers are for the K64F
+WS2812 ws(D9,WS2812_BUF, 0, 5, 5, 0);
+
DigitalOut led(LED1);
int main()
{
- ws.useII(2); // use per-pixel intensity scaling
+ ws.useII(WS2812::PER_PIXEL); // use per-pixel intensity scaling
// set up the colours we want to draw with
int colorbuf[6] = {0x2f0000,0x2f2f00,0x002f00,0x002f2f,0x00002f,0x2f002f};
yacine sidhoum
