Icarus Sensors / Mbed 2 deprecated Serial Console

Dependencies:   mbed

Revision:
0:6e7311915b08
Child:
1:3facaa34f110
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Nov 20 12:02:08 2014 +0000
@@ -0,0 +1,26 @@
+#include "mbed.h"
+ 
+#define BAUD_RATE 9600 //default baud rate
+//#define BAUD_RATE 115200
+//#define BAUD_RATE 230400
+//#define BAUD_RATE 460800 //does not work right now
+//#define BAUD_RATE 921600 //does not work right now
+//as of https://developer.mbed.org/forum/mbed/topic/893/?page=1#comment-4526
+//the list of supported baud rates is
+//110, 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 38400, 57600, 115200, 230400, 460800, 921600
+
+char name[256] = {0};
+ 
+int main() {
+    //Configure boud rate 
+    Serial s(USBTX, USBRX);
+    s.baud(BAUD_RATE);
+    
+    while(1) {        
+        printf("Hi!\r\n");
+        printf("What is your name (input name and hit enter)?\r\n");        
+        scanf( "%s" , name );        
+        printf("Hi %s!\r\n",name);
+        printf("It was nice to meet you!\r\n\r\n\r\n\r\n");
+    }
+}
\ No newline at end of file