i added a blue led

Dependencies:   MODSERIAL 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 #include "MODSERIAL.h"
00003 
00004 DigitalOut myled(LED_GREEN);
00005 DigitalOut bled(LED_BLUE);
00006 MODSERIAL pc(USBTX, USBRX);
00007 
00008 int main()
00009 {
00010     int i = 0;
00011     pc.baud(115200);
00012     pc.printf("Hello World!\n");
00013     
00014     while (true) {
00015         wait(0.5f); // wait a small period of time
00016         pc.printf("%d \n", i); // print the value of variable i
00017         i++; // increment the variable
00018         myled = !myled; // toggle a led
00019         bled = !bled; //toggle blue led
00020     }
00021 }