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.
Diff: WS281X.h
- Revision:
- 9:087006b19049
- Parent:
- 8:0617f524d67d
- Child:
- 16:01e073c662d7
--- a/WS281X.h Thu Aug 11 07:57:18 2016 +0000 +++ b/WS281X.h Fri Aug 12 20:19:06 2016 +0000 @@ -53,11 +53,15 @@ * @param RGBOrder - The order in wich the r, g and b bytes are expected */ WS281X(PinName wirePin, PinMode pinMode = PullNone, int numPixels = MAX_PIXELS, RGBOrder rgbOrder = WS281X::RGB); + WS281X(PinName wirePin, PinMode pinMode = PullNone, RGBColor *Buffer = 0, int numPixels = 0, RGBOrder rgbOrder = WS281X::RGB); ~WS281X(); RGBOrder getRGBOrder() { return _rgbOrder; } void setRGBOrder(RGBOrder rgbOrder = WS281X::RGB); + void setPixelBuffer(RGBColor *Buffer, int numPixels); + int getNumPixels() { return _numPixels; } + void setColor(int index, RGBColor *color, int len); void fillColor(int index, const RGBColor color, int len); void repeatBlock(int block_size); @@ -89,6 +93,7 @@ RGBOrder _rgbOrder; int _1st, _2nd, _3rd; + bool _buf_owner; uint16_t _numPixels; RGBColor *_pixels; RGBColor _dummyPixel;