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.
Fork of blip_rainbow by
Revision 0:60499ad28ea9, committed 2014-07-25
- 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
--- /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
