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:
- 21:cdaee8674e2a
- Parent:
- 20:843cfd0d6adb
- Child:
- 22:222eff98e2af
--- a/SD600A.cpp Thu Oct 11 05:29:59 2012 +0000 +++ b/SD600A.cpp Thu Oct 11 05:39:03 2012 +0000 @@ -72,15 +72,15 @@ uint32_t SD600A::Color(uint8_t r, uint8_t g, uint8_t b) { // Take 23 bits of the value and append them end to end // We cannot drive all ones or it will make the part latch if the previous word ended in one! - return 0xfefefe & ((uint32_t)g << 16) | ((uint32_t)r << 8) | (uint32_t)b; + return 0xfefefe & ((uint32_t)b << 16) | ((uint32_t)r << 8) | (uint32_t)g; } // 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 - pixels[n*3 ] = b & 0xfe; - pixels[n*3+1] = g & 0xfe; + pixels[n*3 ] = g & 0xfe; + pixels[n*3+1] = b & 0xfe; pixels[n*3+2] = r & 0xfe; }