![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
ws2812b sample
Dependencies: PixelArray mbed
Fork of mbed_ws2812b by
Diff: main.cpp
- Revision:
- 1:d9c6619240a3
- Parent:
- 0:afb6ebe20c1f
--- a/main.cpp Sat Dec 13 06:58:47 2014 +0000 +++ b/main.cpp Tue Nov 01 04:36:49 2016 +0000 @@ -27,6 +27,7 @@ #define NLED (4) #define ONE_COLOR + void generate(neopixel::Pixel * out, uint32_t index, uintptr_t val) { #ifdef ONE_COLOR uint32_t pat1 = val / 256; @@ -50,9 +51,13 @@ int main() { - DigitalIn(D3, PullDown); - neopixel::PixelArray array(D3); - + + + + DigitalIn(P1_22, PullDown); + neopixel::PixelArray array(P1_22); + + uint32_t val = 0; while (1) { if ((++val) >= MAX_INDEX) { @@ -60,5 +65,6 @@ } array.update(generate, NLED, val); wait_ms(10); + } }