EXP5

Dependencies:   mbed

main.cpp

Committer:
rx5
Date:
2016-04-12
Revision:
0:f7e8526b7b4f

File content as of revision 0:f7e8526b7b4f:

#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
    }
    
}