Alan Rager / Mbed 2 deprecated lightstrip_adafruit

Dependencies:   Adafruit_WS2801 mbed

Files at this revision

API Documentation at this revision

Comitter:
AlanRager
Date:
Fri Jan 16 05:42:59 2015 +0000
Parent:
0:63c1f03ccb9c
Commit message:
Wait... this is the actual changes to lightstrip_adafruit? Anyway - here's the code that made things kinda blink, just less bright because it was hurting my eyes.

Changed in this revision

Adafruit_WS2801.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
--- a/Adafruit_WS2801.lib	Fri Jan 16 05:36:27 2015 +0000
+++ b/Adafruit_WS2801.lib	Fri Jan 16 05:42:59 2015 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/users/SomeRandomBloke/code/Adafruit_WS2801/#b99161307af3
+http://developer.mbed.org/users/AlanRager/code/Adafruit_WS2801/#b99161307af3
--- a/main.cpp	Fri Jan 16 05:36:27 2015 +0000
+++ b/main.cpp	Fri Jan 16 05:42:59 2015 +0000
@@ -18,13 +18,12 @@
         for (i = 0; i < LED_NUM; i++){
             leds.setPixelColor(
                 i,
-                ( color & RED ),
-                ( color & BLUE ),
-                ( color & GREEN )
+                ( color & RED > 0 ? 4 : 0 ),
+                ( color & BLUE > 0 ? 4 : 0 ),
+                ( color & GREEN > 0 ? 4 : 0 )
             ); 
         }
         leds.show();
-        wait_ms(1);
         
         color = color * 2;