Interfaçage NeoPixel Ring 12, LPRO MECSE, Arnaud A.

Revision:
3:f486b56187e2
Parent:
2:327eb27271b0
Child:
4:22b0f282731b
--- a/neoPixelRing12.cpp	Mon Jun 22 21:54:01 2020 +0000
+++ b/neoPixelRing12.cpp	Tue Jun 23 10:33:03 2020 +0000
@@ -328,4 +328,27 @@
     return true;
 }
 
+bool NeoPixelRing12::rainbowAnimations(){
+    char buffer=0;
+    uint32_t rgb=0;
+    char redBuffer[12][7]= {{"660000"},{"663300"},{"666600"},{"3366"},
+                            {"006600"},{"006633"},{"006666"},{"003366"},
+                            {"000066"},{"330066"},{"660066"},{"660033"}};
+    int i, y, z, x;
+    for(i=0; i<12; i++){
+        initLights();
+        for(z=0; z<i; z++)
+            setLightsNoReset(1, redBuffer[i-z]);
+        setLightsNoReset(1, redBuffer[i]);
+        rst();
+        wait(0.07); 
+    }
+    for(i=1; i<=12; i++){
+        initLights();
+        setLightsNoReset(i, "000000");
+        rst();
+        wait(0.07); 
+    }  
+    return true;
+}