Rahul Abhyankar
/
uart_printf
serial communication @ 921600bps - Working fine on hyperterminal as well as bray's
Diff: main.cpp
- Revision:
- 0:d57a982ac59a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Mar 11 03:31:42 2010 +0000 @@ -0,0 +1,20 @@ +#include "mbed.h" + +Serial pc(USBTX, USBRX); +Timer t; +DigitalOut led1(LED1); +int main() +{ + pc.baud(921600); + pc.format(8,Serial::None,1); + while(1) + { + t.start(); + pc.printf("Hello World! @921.600kbps\n",1285); + t.stop(); + pc.printf("The time taken was %f seconds\n", t.read()); + t.reset(); + wait(1.0); + led1 = !led1; + } +}