Ejercicio1

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 DigitalOut ledInterno(LED1);
00004 BusOut led(D5,D6,D7);
00005 int i;
00006 int len = sizeof(led)/sizeof(led[0]);
00007 
00008 void ledsIteration() {
00009     while(1) {
00010         ledInterno = !ledInterno;
00011         wait(0.2);
00012         ledInterno = !ledInterno;
00013         for(i=0;i<=len;i++) {
00014             led[i] = !led[i];
00015             wait(0.2);
00016             led[i] = !led[i];
00017         }
00018         
00019     }
00020 }
00021 
00022 int main() {
00023     ledsIteration();
00024 }