Edutech IoT Team / Mbed 2 deprecated Eg4_Serial_TxRx

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
dwijaybane
Date:
Wed Oct 07 12:36:57 2015 +0000
Parent:
0:4d026a6a21e1
Commit message:
updated comments

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Oct 06 07:10:15 2015 +0000
+++ b/main.cpp	Wed Oct 07 12:36:57 2015 +0000
@@ -1,10 +1,12 @@
-#include "mbed.h"
+#include "mbed.h"   // Basic Library required for onchip peripherals
  
-Serial pc(USBTX, USBRX); // tx, rx
+/* Create Objects */ 
+Serial pc(USBTX, USBRX); // Create serial object named pc using USB Tx and Rx
  
+/* Main Program */ 
 int main() {
-    pc.printf("Hello World!\n\r");
-    pc.printf("Type any characters\n\r");
+    pc.printf("Hello World!\n\r"); // Greeting message
+    pc.printf("Type any characters\n\r"); // Instruction for user to type
     while(1) {
         pc.putc(pc.getc());  //echo recieved character
     }