Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Serial_HelloWorld_Mbed by
Revision 1:8a1ffe1119db, committed 2015-12-17
- Comitter:
- captaintim
- Date:
- Thu Dec 17 22:01:30 2015 +0000
- Parent:
- 0:879aa9d0247b
- Commit message:
- Added carriage return to printf string and didn't need the "pc." either for print f.
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 879aa9d0247b -r 8a1ffe1119db main.cpp
--- a/main.cpp Tue Feb 12 17:39:05 2013 +0000
+++ b/main.cpp Thu Dec 17 22:01:30 2015 +0000
@@ -1,10 +1,21 @@
#include "mbed.h"
-Serial pc(USBTX, USBRX); // tx, rx
+ //using TeraTerm, this worked out of the box
+
+ //added carriage return and in worked in the sequence \r (carriage return) followed by \n (new line) all within the String
+
+//Serial pc(USBTX, USBRX); // tx, rx
+
+//comment out line 11, 17-20 and printf works fine--alternately if you eliminate "pc." on the second printf, it too will work.
+
+Serial pc(USBTX, USBRX);
+
int main() {
- pc.printf("Hello World!\n");
+ printf("Hello World!\r\n");
+
+ pc.printf("Echoes back to the screen anything you type\r\n");
while(1) {
- pc.putc(pc.getc() + 1);
+ pc.putc(pc.getc());
}
}
\ No newline at end of file
