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.
Dependencies: Adafruit_WS2801 mbed
Diff: main.cpp
- Revision:
- 0:63c1f03ccb9c
- Child:
- 1:54cf3c557fdf
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Fri Jan 16 05:36:27 2015 +0000
@@ -0,0 +1,35 @@
+#include "mbed.h"
+#include "Adafruit_WS2801.h"
+
+#define LED_NUM 32
+#define RED 1
+#define GREEN 2
+#define BLUE 4
+
+//Init strip of 32
+Adafruit_WS2801 leds( LED_NUM, SPI_MOSI, SPI_SCK, WS2801_RGB );
+
+int main () {
+ int i, color;
+
+ color = 1;
+
+ while (1) {
+ for (i = 0; i < LED_NUM; i++){
+ leds.setPixelColor(
+ i,
+ ( color & RED ),
+ ( color & BLUE ),
+ ( color & GREEN )
+ );
+ }
+ leds.show();
+ wait_ms(1);
+
+ color = color * 2;
+
+ if ( color > GREEN ) {
+ color = RED ;
+ }
+ }
+}
\ No newline at end of file