
Error in Serial Printing
main.cpp@0:c9a8a9f0e3b6, 2014-06-25 (annotated)
- Committer:
- adaveiitm
- Date:
- Wed Jun 25 06:57:18 2014 +0000
- Revision:
- 0:c9a8a9f0e3b6
Hello World
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
adaveiitm | 0:c9a8a9f0e3b6 | 1 | /*Code to print simple Hello World statement with a timestamp */ |
adaveiitm | 0:c9a8a9f0e3b6 | 2 | #include "mbed.h" |
adaveiitm | 0:c9a8a9f0e3b6 | 3 | Serial pc(USBTX,USBRX); //Include serial interface with pc |
adaveiitm | 0:c9a8a9f0e3b6 | 4 | Timer t ; //Function to include the timestamp |
adaveiitm | 0:c9a8a9f0e3b6 | 5 | int main(){ |
adaveiitm | 0:c9a8a9f0e3b6 | 6 | //wait(0.1); |
adaveiitm | 0:c9a8a9f0e3b6 | 7 | t.start(); |
adaveiitm | 0:c9a8a9f0e3b6 | 8 | pc.printf("Hello World-----%f\n\r",t.read()); |
adaveiitm | 0:c9a8a9f0e3b6 | 9 | fflush(stdout); //In order to flush out buffer |
adaveiitm | 0:c9a8a9f0e3b6 | 10 | t.stop(); |
adaveiitm | 0:c9a8a9f0e3b6 | 11 | } |