Heroic Robotics / SD600A

Fork of SD600A by Heroic Robotics

Revision:
27:6667543f3b28
Parent:
26:98163818a82e
Child:
28:a905a4738dd4
--- a/SD600A.cpp	Sat Oct 13 04:49:47 2012 +0000
+++ b/SD600A.cpp	Thu Apr 11 22:15:45 2013 +0000
@@ -126,6 +126,15 @@
     pixels[n*3+2] = r & 0xfe;
 }
 
+// Set all in one function call, assuming GRB ordering
+void SD600A::setPackedPixels(uint8_t * buffer, uint32_t n) {
+    if (n >= numLEDs) return;
+    for (int i=0; i<n*3; i++)
+        buffer[i] &= 0xfe;
+    memcpy(pixels, buffer, (size_t) (n*3));
+}
+
+
 void SD600A::setPixelG(uint16_t n, uint8_t g) {
     if (n >= numLEDs) return; // '>=' because arrays are 0-indexed
     n=numLEDs-(n+1);