EXP5

Dependencies:   mbed

Revision:
0:f7e8526b7b4f
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