Pablo Clemente / Mbed 2 deprecated blip_rainbow

Dependencies:   PixelArray mbed

Fork of blip_rainbow by Alberto Piganti

Files at this revision

API Documentation at this revision

Comitter:
JacobBramley
Date:
Fri Jul 25 15:22:59 2014 +0000
Child:
1:ca76237d2965
Commit message:
Demo for the neopixel-spi library. This is untested because I don't yet have any NeoPixels to test it with.

Changed in this revision

BurstSPI.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
neopixel-spi.lib Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/BurstSPI.lib	Fri Jul 25 15:22:59 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/Sissors/code/BurstSPI/#8585ddebd28b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Jul 25 15:22:59 2014 +0000
@@ -0,0 +1,28 @@
+#include "mbed.h"
+#include "neopixel-spi.h"
+
+// A backing store for the pixel data.
+static size_t const count = 16;
+neopixel::Pixel pixels[count];
+
+// The pixel array control class.
+neopixel::Array array(p30);
+
+uint8_t IntensityForIndex(size_t index) {
+  uint32_t c = index % 512;
+  return (c >= 256) ? (256 - c) : c;
+}
+
+int main() {
+  size_t offset = 0;
+  while (1) {
+    for (size_t i = 0; i < count; i++) {
+      pixels[i].red   = IntensityForIndex((i * 10) + offset);
+      pixels[i].green = IntensityForIndex((i * 20) + offset);
+      pixels[i].blue  = IntensityForIndex((i * 40) + offset);
+    }
+    array.Update(pixels, count);
+    wait_ms(10);
+    offset++;
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Jul 25 15:22:59 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/04dd9b1680ae
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/neopixel-spi.lib	Fri Jul 25 15:22:59 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/JacobBramley/code/neopixel-spi/#adbbe3e9f2c5