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: LPD8806.cpp
- Revision:
- 3:a415f73507c9
- Parent:
- 2:af5af64e114d
- Child:
- 4:0b75eb84a6d2
--- a/LPD8806.cpp Sun Sep 16 13:09:54 2012 +0000 +++ b/LPD8806.cpp Mon Oct 01 02:30:12 2012 +0000 @@ -16,7 +16,7 @@ clk(clockPin) { // Allocate 3 bytes per pixel: numLEDs = n; - if (NULL != (pixels = (uint8_t *)malloc(numLEDs * 3))) { + if ((pixels = (uint8_t *)malloc(numLEDs * 3))) { memset(pixels, 0x80, numLEDs * 3); // Init to RGB 'off' state } } @@ -88,13 +88,6 @@ pixels[n*3+2] = b | 0x80; } -void LPD8806::setPixelGB(uint16_t n, uint8_t g, uint8_t b) { - if (n >= numLEDs) return; // '>=' because arrays are 0-indexed - - pixels[n*3 ] = g | 0x80; - pixels[n*3+2] = b | 0x80; -} - void LPD8806::setPixelR(uint16_t n, uint8_t r) { if (n >= numLEDs) return; // '>=' because arrays are 0-indexed