NeoPixel sample

Dependencies:   mbed NeoPixel

Files at this revision

API Documentation at this revision

Comitter:
tichise
Date:
Thu Jan 02 07:57:58 2020 +0000
Commit message:
NeoPixel sample

Changed in this revision

NeoPixel.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 124662fe9af9 NeoPixel.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/NeoPixel.lib	Thu Jan 02 07:57:58 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/tichise/code/NeoPixel/#415459e3f93b
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
diff -r 000000000000 -r 124662fe9af9 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Jan 02 07:57:58 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file