STDin and STDout example

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
lmottola
Date:
Tue Mar 19 13:54:37 2019 +0000
Parent:
1:2f9d56e97f30
Commit message:
Added alternate version to process serial data from a host program

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon Mar 18 11:42:27 2019 +0000
+++ b/main.cpp	Tue Mar 19 13:54:37 2019 +0000
@@ -3,12 +3,18 @@
 Serial pc(USBTX, USBRX);
 
 int main() {
+    
     char buffer[128];
-
     pc.printf("Starting..\n");
+//    int count = 0;
 
     while (1) {
         pc.gets(buffer, 4);
         pc.printf("I got '%s'\n", buffer);
+ 
+        // Alternate version to process data over serial from a host program...    
+//        pc.printf("The counter is '%d'\n", count);
+//        count++;
+//        wait (1);
     }
 }