ShiftBrite control class Hello World program

Dependencies:   ShiftBrite mbed

Files at this revision

API Documentation at this revision

Comitter:
jwaters9
Date:
Mon Nov 03 05:55:24 2014 +0000
Commit message:
first commit

Changed in this revision

ShiftBrite.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 ab368b7d8765 ShiftBrite.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ShiftBrite.lib	Mon Nov 03 05:55:24 2014 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/jwaters9/code/ShiftBrite/#466ea48e852a
diff -r 000000000000 -r ab368b7d8765 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Nov 03 05:55:24 2014 +0000
@@ -0,0 +1,34 @@
+#include "mbed.h"
+#include "ShiftBrite.h"
+
+//ShiftBrite Demo
+//DigitalOut latch(p15);
+//DigitalOut enable(p16);
+//Cycles through different colors on RGB LED
+SPI spi(p11, p12, p13);
+
+ShiftBrite myBrite(p15,p16,spi); //latch, enable, spi
+
+int main() {
+int r,g,b;
+r=g=b=50;
+    
+    while(1) {
+        myBrite.Write(255,255,255);
+        wait(0.5);
+        myBrite.Write(0,0,255);
+        wait(0.5);
+        myBrite.Write(0,255,0);
+        wait(0.5);
+        myBrite.Write(255,0,0);
+        wait(0.5);
+        
+        myBrite.Brightness(r,g,b);
+        if(r<1023)
+            r+=50;
+        else
+            r=50;
+        g=b=r;
+        
+    }
+}
diff -r 000000000000 -r ab368b7d8765 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Nov 03 05:55:24 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/031413cf7a89
\ No newline at end of file