Color pixels library using WS2812B and nRF51822

Dependents:   BLE_Color_Pixels Grove_Node BLE_HeartRate

Color pixels library using WS2812B and nRF51822 (16Hz)

http://www.seeedstudio.com/depot/bmz_cache/4/4f346dc15724a7b5a5c1383253aeefc9.image.530x397.jpg

It's for

Revision:
3:91af7b451005
Parent:
2:5c805323a2c0
Child:
4:16ef874fa57f
--- a/color_pixels.cpp	Tue Oct 28 11:03:20 2014 +0800
+++ b/color_pixels.cpp	Thu Nov 06 02:19:42 2014 +0000
@@ -157,6 +157,17 @@
     set_color(index, c.r, c.g, c.b);
 }
 
+void ColorPixels::set_all_color(uint8_t r, uint8_t g, uint8_t b)
+{
+    for (int i = 0; i < num; i++) {
+        colors[i].r = r;
+        colors[i].g = g;
+        colors[i].b = b;
+    }
+
+    update();
+}
+
 void ColorPixels::update()
 {
     uint32_t mask =  1 << pin;
@@ -274,3 +285,15 @@
     
     update();
 }
+
+void ColorPixels::rainbow(uint8_t r, uint8_t g, uint8_t b)
+{
+    color_t c;
+    
+    c.r = r;
+    c.g = g;
+    c.b = b;
+    
+    rainbow(c.rgb);
+}
+