Serial Test

Dependencies:   mbed

Fork of Minor_test_serial by First Last

Files at this revision

API Documentation at this revision

Comitter:
carlmaykel
Date:
Mon Sep 12 09:58:36 2016 +0000
Parent:
0:c8f15874531b
Commit message:
Edit the new line problem and changed the MODSERIAL to SERIAL

Changed in this revision

MODSERIAL.lib Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r c8f15874531b -r dbac20029340 MODSERIAL.lib
--- a/MODSERIAL.lib	Wed Sep 02 14:50:46 2015 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/Sissors/code/MODSERIAL/#8ef4f91813fd
diff -r c8f15874531b -r dbac20029340 main.cpp
--- a/main.cpp	Wed Sep 02 14:50:46 2015 +0000
+++ b/main.cpp	Mon Sep 12 09:58:36 2016 +0000
@@ -1,18 +1,18 @@
 #include "mbed.h"
-#include "MODSERIAL.h"
+
 
 DigitalOut myled(LED_GREEN);
-MODSERIAL pc(USBTX, USBRX);
+Serial pc(USBTX, USBRX);
 
 int main()
 {
     int i = 0;
     pc.baud(115200);
-    pc.printf("Hello World!\n");
+    pc.printf("Hello World!\n\r");
     
     while (true) {
         wait(0.5f); // wait a small period of time
-        pc.printf("%d \n", i); // print the value of variable i
+        pc.printf("%d \n\r", i); // print the value of variable i
         i++; // increment the variable
         myled = !myled; // toggle a led
     }