FRDM-K64 Serial communication basic example using mbed

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FRDM-K64 Serial communication basic example using mbed

FRDM-K64 Serial communication basic example using mbed

Here you can find both the code and project files for the Serial communication project, in this example the serial port (UART) is configured to establish communication between the computer using a serial terminal and the evaluation board. The default baud rate for the serial port is 9600 bauds. The code also implements an echo function, any key pressed in the computer's keyboard will be captured and displayed in the serial terminal.

If your computer does not have a serial terminal you can download Tera Term from the following link:

Tera Term Open Source Project

The communication is established through the USB cable attached to the OpenSDA USB port.

Code:

#include "mbed.h"

//Digital output declaration

DigitalOut Blue(LED3);

//Serial port (UART) configuration

Serial pc(USBTX,USBRX);

int main()

{

    Blue=1;

    pc.printf("Serial code example\r\n");   

    while(1)

    {

        Blue=0;

        pc.putc(pc.getc());

    }

  

}

Attachments
No ratings
Version history
Last update:
‎06-27-2014 10:56 AM
Updated by: