Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
dbayuadi
Date:
Wed Sep 02 16:28:25 2015 +0000
Commit message:
Part of the assignment 4 - Minor Biorobotics

Changed in this revision

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 f78a2268a47c main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Sep 02 16:28:25 2015 +0000
@@ -0,0 +1,40 @@
+#include "mbed.h"
+ 
+Serial pc(USBTX, USBRX); // tx, rx
+DigitalOut red(LED_RED);
+DigitalOut green(LED_GREEN);
+DigitalOut blue(LED_BLUE);
+ 
+float brightness = 0.0;
+ 
+int main() {
+    pc.baud(9600);
+    pc.printf("r for red, g for green and b for blue\n");
+            
+    while(1) {
+     
+        char c = pc.getc();
+        switch(c)
+        {
+            case 'r':
+            red = 0;
+            green = blue = 1;
+        
+            break;
+            case 'g':
+            green = 0;
+            red = blue = 1;
+            break;
+            case 'b':
+            blue = 0;
+            red = green = 1;
+            break;
+            case 'o':
+            red = green = blue = 1;
+            break;
+           
+
+        }
+ 
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r f78a2268a47c mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Sep 02 16:28:25 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/ba1f97679dad
\ No newline at end of file