frdm serial example for the Freescale freedom platform

Dependencies:   mbed

Fork of frdm_serial by Freescale

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 DigitalOut myled(LED_GREEN);
00004 Serial pc(USBTX, USBRX);
00005 
00006 int main()
00007 {
00008     int i = 0;
00009     pc.printf("Hello World!\n");
00010 
00011     while (true) {
00012         wait(0.5f); // wait a small period of time
00013         pc.printf("%d \n", i); // print the value of variable i
00014         i++; // increment the variable
00015         myled = !myled; // toggle a led
00016     }
00017 }