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.
Dependents: STM32FC_RGB_WS2812
Revision 1:8910a1fcbdb0, committed 2016-12-10
- Comitter:
- devararendy
- Date:
- Sat Dec 10 09:18:10 2016 +0000
- Parent:
- 0:f080cb888db6
- Commit message:
- added sendColors function, for sending color buffer to all LEDs
Changed in this revision
| WS2812.cpp | Show annotated file Show diff for this revision Revisions of this file |
| WS2812.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/WS2812.cpp Sat Dec 10 08:18:58 2016 +0000
+++ b/WS2812.cpp Sat Dec 10 09:18:10 2016 +0000
@@ -247,4 +247,12 @@
{
writeColor(RGB);
sendReset();
+}
+void WS2812::sendColors(uint32_t * ColorBuffer)
+{
+ for(int x=0;x<LED_Qty;x++)
+ {
+ writeColor(*(&ColorBuffer[x]));
+ }
+ sendReset();
}
\ No newline at end of file
--- a/WS2812.h Sat Dec 10 08:18:58 2016 +0000 +++ b/WS2812.h Sat Dec 10 09:18:10 2016 +0000 @@ -15,7 +15,7 @@ ~WS2812(); void writeColor(uint32_t RGB); void send1Color(uint32_t RGB); - + void sendColors(uint32_t * ColorBuffer); void sendReset(); private: