Jasper Lee / twr_helloworld

Dependencies:   mbed_helloworld

Fork of frdm_helloworld by Freescale

Files at this revision

API Documentation at this revision

Comitter:
Jasper_lee
Date:
Tue Dec 23 03:35:48 2014 +0000
Parent:
2:87db61b14dff
Child:
4:b851b9236d1a
Commit message:
change some io setting for TWR-K22F120M

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show diff for this revision Revisions of this file
mbed.lib Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon Apr 07 20:10:53 2014 +0000
+++ b/main.cpp	Tue Dec 23 03:35:48 2014 +0000
@@ -5,7 +5,8 @@
 DigitalIn sw2(SW2);
 DigitalIn sw3(SW3);
 Serial pc(USBTX, USBRX);
-
+char  str[6];
+uint32_t i;
 void check_sw2(void)
 {
     if (sw2 == 0) {
@@ -22,11 +23,15 @@
         led_green = 0;
         led_red = 1;
         pc.printf("5 characters will be echoed. Start typing. \n");
-        for (uint32_t i = 0; i < 5; i++) {
-            pc.putc(pc.getc());
+        for ( i = 0; i < 5; i++) {
+            str[i] = pc.getc();
+  //          pc.putc(pc.getc());
         }
+        str[i] ='\0';
+        pc.puts(str);
         pc.putc(13); /* CR */
         pc.putc(10); /* LF */
+        pc.printf("Test Finished \n");
     }
 }
 
--- a/mbed.bld	Mon Apr 07 20:10:53 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/6473597d706e
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.lib	Tue Dec 23 03:35:48 2014 +0000
@@ -0,0 +1,1 @@
+mbed#b16d94660a33