led and serial test

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 Serial pc(USBTX, USBRX); // tx, rx
00004 
00005 DigitalOut myled1(LED1);
00006 DigitalOut myled2(LED2);
00007 
00008 int main() {
00009     while(1) {
00010         myled1 = 1;
00011         myled2 = 0;
00012         pc.printf("led 1 on\r\n");
00013         wait(0.5);
00014         myled1 = 0;
00015         myled2 = 1;
00016         pc.printf("led 2 on\r\n");
00017         wait(0.2);
00018     }
00019 }