S5 / Mbed 2 deprecated HelloWorld

Dependencies:   mbed

Fork of HelloWorld by Simon Ford

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 DigitalOut myleds [] = {LED1, LED2, LED3, LED4};
00004 Serial pc(USBTX, USBRX);
00005 
00006 int main() {
00007     while(1) {
00008         for(int i = 0 ; i < 4 ; i++)
00009             myleds[i] = 1;
00010         pc.printf("Allume!\r\n");
00011         wait(0.2);
00012         for(int i = 0 ; i < 4 ; i++)
00013             myleds[i] = 0;
00014         pc.printf("Ferme!\r\n");
00015         wait(0.2);
00016     }
00017 }