Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of SD600A by
Diff: SD600A.cpp
- Revision:
- 22:222eff98e2af
- Parent:
- 21:cdaee8674e2a
- Child:
- 23:2e60470dd134
diff -r cdaee8674e2a -r 222eff98e2af SD600A.cpp
--- 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;
