Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
sivaieee
Date:
Mon Nov 14 19:53:41 2016 +0000
Commit message:
Serial Comms control

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 16598bc0eb44 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Nov 14 19:53:41 2016 +0000
@@ -0,0 +1,21 @@
+#include "mbed.h"
+ 
+Serial pc(USBTX, USBRX); // tx, rx
+DigitalOut led(LED1);
+ 
+int main() {
+ {   pc.printf("Press 'u' to turn off Led, 'd' to turn it on\n");
+ 
+  while(1) {
+        char c = pc.getc();
+       pc.putc(c);
+       if(c == 'u'){
+           led = 1;
+     }
+       if(c == 'd') {
+           led = 0;
+       } 
+ 
+    }
+}
+}
diff -r 000000000000 -r 16598bc0eb44 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Nov 14 19:53:41 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/0ab6a29f35bf
\ No newline at end of file