yes

Dependencies:   MODSERIAL mbed

Fork of Minor_test_serial by First Last

Files at this revision

API Documentation at this revision

Comitter:
luukblaauw
Date:
Tue Sep 13 16:38:06 2016 +0000
Parent:
0:c8f15874531b
Commit message:
Jeej

Changed in this revision

MODSERIAL.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 c8f15874531b -r c1f9db55a784 MODSERIAL.lib
--- a/MODSERIAL.lib	Wed Sep 02 14:50:46 2015 +0000
+++ b/MODSERIAL.lib	Tue Sep 13 16:38:06 2016 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/Sissors/code/MODSERIAL/#8ef4f91813fd
+http://mbed.org/users/Sissors/code/MODSERIAL/#4737f8a5b018
diff -r c8f15874531b -r c1f9db55a784 main.cpp
--- a/main.cpp	Wed Sep 02 14:50:46 2015 +0000
+++ b/main.cpp	Tue Sep 13 16:38:06 2016 +0000
@@ -7,13 +7,20 @@
 int main()
 {
     int i = 0;
-    pc.baud(115200);
+    pc.baud(9600);
     pc.printf("Hello World!\n");
-    
-    while (true) {
-        wait(0.5f); // wait a small period of time
-        pc.printf("%d \n", i); // print the value of variable i
-        i++; // increment the variable
-        myled = !myled; // toggle a led
-    }
+    char c;
+    while(true)
+    {
+        c = pc.getc();
+        if (c != NULL)
+        {
+            pc.printf("%c\n",c);
+                while (true) {
+                wait(0.5f); // wait a small period of time
+                i++; // increment the variable
+                myled = !myled; // toggle a led
+            };
+        };
+    };
 }
diff -r c8f15874531b -r c1f9db55a784 mbed.bld
--- a/mbed.bld	Wed Sep 02 14:50:46 2015 +0000
+++ b/mbed.bld	Tue Sep 13 16:38:06 2016 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/8ed44a420e5c
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/2e9cc70d1897
\ No newline at end of file