test1

Dependencies:   mbed

Fork of Minor_test_serial by First Last

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.baud(115200);
00010     pc.printf("Hello World!\n\r");
00011     
00012     while (true) {
00013         wait(0.5f); // wait a small period of time
00014         pc.printf("%d \n", i); // print the value of variable i
00015         i++; // increment the variable
00016         myled = !myled; // toggle a led
00017     }
00018 }