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.
Dependencies: PixelArray WS2812 mbed
Fork of WS2812_Example by
main.cpp
00001 #include "mbed.h" 00002 #include "WS2812.h" 00003 #include "PixelArray.h" 00004 00005 #define WS2812_BUF 3 00006 #define NUM_COLORS 6 00007 #define NUM_LEDS_PER_COLOR 1 00008 00009 PixelArray px(WS2812_BUF); 00010 00011 // See the program page for information on the timing numbers 00012 // The given numbers are for the K64F 00013 WS2812 ws(D6, WS2812_BUF, 0, 5, 5, 0); 00014 00015 int main() 00016 { 00017 px.Set(0, 0); 00018 px.Set(1, 0x00ff00); 00019 px.Set(2, 0x00ee00); 00020 00021 // Now the buffer is written, rotate it 00022 // by writing it out with an increasing offset 00023 while (1) { 00024 ws.write(px.getBuf()); 00025 wait(0.075); 00026 } 00027 00028 }
Generated on Sat Jul 16 2022 21:49:55 by
1.7.2
