Icarus Sensors / Mbed 2 deprecated Serial Console

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
smigielski
Date:
Thu Nov 20 12:02:08 2014 +0000
Child:
1:3facaa34f110
Commit message:
Test for serial console

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Nov 20 12:02:08 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/031413cf7a89
\ No newline at end of file