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:
- 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);