nima aghli
/
WS2811
for thww WS2811 RGB
Fork of WS2811 by
Diff: WS2811.cpp
- Revision:
- 1:165513b4e20a
- Parent:
- 0:c6a6fa47dadc
- Child:
- 2:ccf3f0c36dae
--- a/WS2811.cpp Fri Apr 15 17:55:30 2016 +0000 +++ b/WS2811.cpp Mon Apr 18 07:38:23 2016 +0000 @@ -47,9 +47,33 @@ wait(DELAY); // wait for the supply voltage } -void off(){ // set all RGBs off +void clear(){ // set all RGBs off sendColours(0, 0, 0, 0); sendColours(1, 0, 0, 0); sendColours(2, 0, 0, 0); - wait(0.5); + wait_ms(OFF_DELAY); +} + +void runlight(float waittime){ + sendColours(0, 100, 0, 0); + wait(waittime); + sendColours(1, 0, 100, 0); + wait(waittime); + sendColours(2, 0, 0, 100); + wait(waittime); + clear(); + sendColours(0, 0, 0, 100); + wait(waittime); + sendColours(1, 100, 0, 0); + wait(waittime); + sendColours(2, 0, 100, 0); + wait(waittime); + clear(); + sendColours(0, 0, 100, 0); + wait(waittime); + sendColours(1, 0, 0, 100); + wait(waittime); + sendColours(2, 100, 0, 0); + wait(waittime); + clear(); } \ No newline at end of file