![](/media/cache/profiles/36388716_10156379864393903_5314622498057224192_n.jpg.50x50_q85.jpg)
NeoPixel sample
Diff: main.cpp
- Revision:
- 0:124662fe9af9
diff -r 000000000000 -r 124662fe9af9 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Jan 02 07:57:58 2020 +0000 @@ -0,0 +1,24 @@ +#include "mbed.h" +#include "neopixel.h" + + +NeoPixelOut neoPixel(p11); + +int main() { + wait(0.2); // wait for HSE to stabilize + + neoPixel.global_scale = 1.0f; // Adjust brightness + neoPixel.normalize = true; // Equalize brightness to make r + g + b = 255 + + Pixel pixels[6]; + pixels[0].hex = 0xFF0000; + pixels[1].hex = 0xFFFF00; + pixels[2].hex = 0x00FF00; + pixels[3].hex = 0x00FFFF; + pixels[4].hex = 0x0000FF; + pixels[5].hex = 0xFF00FF; + + neoPixel.send(pixels, 6); + + while(1); +} \ No newline at end of file