nima aghli
/
WS2811
for thww WS2811 RGB
Fork of WS2811 by
Diff: WS2811.cpp
- Revision:
- 2:ccf3f0c36dae
- Parent:
- 1:165513b4e20a
- Child:
- 3:2fbb2f0e79fb
--- a/WS2811.cpp Mon Apr 18 07:38:23 2016 +0000 +++ b/WS2811.cpp Fri Apr 29 07:46:25 2016 +0000 @@ -7,7 +7,7 @@ #include "mbed.h" #include "WS2811.h" -uint8_t ledmatrix[3][3]; +uint8_t ledmatrix[LED_MAX][3]; DigitalOut myled(p20); @@ -35,6 +35,7 @@ } void sendColours(int pos, uint8_t r, uint8_t g, uint8_t b){ + __disable_irq; // disable interrupt to speed up writeled(pos, g, r, b); // call the underprogramm for(int led = 0; led < LED_MAX; led++){ // write the matrix on the RGBs @@ -45,6 +46,7 @@ } } wait(DELAY); // wait for the supply voltage + __enable_irq; // enable interrupt pin for the basic uses } void clear(){ // set all RGBs off @@ -61,19 +63,19 @@ wait(waittime); sendColours(2, 0, 0, 100); wait(waittime); - clear(); + //clear(); sendColours(0, 0, 0, 100); wait(waittime); sendColours(1, 100, 0, 0); wait(waittime); sendColours(2, 0, 100, 0); wait(waittime); - clear(); + //clear(); sendColours(0, 0, 100, 0); wait(waittime); sendColours(1, 0, 0, 100); wait(waittime); sendColours(2, 100, 0, 0); wait(waittime); - clear(); + //clear(); } \ No newline at end of file