Heroic Robotics / SD600A

Fork of SD600A by Heroic Robotics

Revision:
22:222eff98e2af
Parent:
21:cdaee8674e2a
Child:
23:2e60470dd134
--- a/SD600A.cpp	Thu Oct 11 05:39:03 2012 +0000
+++ b/SD600A.cpp	Thu Oct 11 07:49:21 2012 +0000
@@ -78,6 +78,7 @@
 // store the rgb component in our array
 void SD600A::setPixelColor(uint16_t n, uint8_t r, uint8_t g, uint8_t b) {
     if (n >= numLEDs) return; // '>=' because arrays are 0-indexed
+    n=numLEDs-(n+1);
 
     pixels[n*3  ] = g & 0xfe;
     pixels[n*3+1] = b & 0xfe;
@@ -86,25 +87,25 @@
 
 void SD600A::setPixelR(uint16_t n, uint8_t r) {
     if (n >= numLEDs) return; // '>=' because arrays are 0-indexed
-
+    n=numLEDs-(n+1);
     pixels[n*3+2] = r & 0xfe;
 }
 
 void SD600A::setPixelG(uint16_t n, uint8_t g) {
     if (n >= numLEDs) return; // '>=' because arrays are 0-indexed
-
+    n=numLEDs-(n+1);
     pixels[n*3+1] = g & 0xfe;
 }
 
 void SD600A::setPixelB(uint16_t n, uint8_t b) {
     if (n >= numLEDs) return; // '>=' because arrays are 0-indexed
-
+    n=numLEDs-(n+1);
     pixels[n*3] = b & 0xfe;
 }
 
 void SD600A::setPixelColor(uint16_t n, uint32_t c) {
     if (n >= numLEDs) return; // '>=' because arrays are 0-indexed
-
+    n=numLEDs-(n+1);
     pixels[n*3  ] = (c >> 16) & 0xfe;
     pixels[n*3+1] = (c >>  8) & 0xfe;
     pixels[n*3+2] =  c        & 0xfe;