ravi butani
/
EXP5_UART_BASIC
EXP5
Revision 0:f7e8526b7b4f, committed 2016-04-12
- Comitter:
- rx5
- Date:
- Tue Apr 12 06:09:52 2016 +0000
- Commit message:
- MEFGI RAJKOT
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 |
diff -r 000000000000 -r f7e8526b7b4f main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Apr 12 06:09:52 2016 +0000 @@ -0,0 +1,21 @@ +#include "mbed.h" +Serial pc(USBTX, USBRX); // Initlize UART on USB port of KL25Z with default Baud 9600 + +int main() +{ + int i=0; + float f=0; + // pc.baud(115200); // uncomment this line and update baudrate to cahnge baud rate from 9600 default + pc.printf("\r\n"); // print startup message from new line on UART Terminal + pc.printf("Experiment - 5\r\n"); // print startup message on UART Terminal + pc.printf("UART Interfacing\r\n"); // print startup message on UART Terminal + wait(3.0); // wait 3 second to show startup message + while(1) // loop forever + { + pc.printf("Int i = %d \t Float f = %0.2f \r\n",i,f); // print value of i and f on UART Terminal + i=i+1; // update i + f=f+0.01; // update f + wait(1.0); // Wait for 1 second + } + +} \ No newline at end of file
diff -r 000000000000 -r f7e8526b7b4f mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Apr 12 06:09:52 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/99a22ba036c9 \ No newline at end of file