M0_Übung_2c

Dependencies:   mbed

Fork of M0_Lektion02c by Gottfried Enenkel

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h" 
00002 
00003 // **** DEFINITIONEN ****
00004 
00005 BusOut led(P1_8,P1_9,P1_10,P1_11);
00006 
00007  // **** HAUPTPROGRAMM ****
00008  
00009 int main() 
00010 {
00011     while(1)   
00012         {
00013             led=0x0;        //LED **** 0000
00014             wait(0.2);
00015             led=0x1;        //LED ***X 0001
00016             wait(0.2);
00017             led=0x2;        //LED **X* 0010        
00018             wait (0.2);
00019             led=0x4;        //LED *X** 0100
00020             wait (0.2);
00021             led=0x8;        //LED X*** 1000
00022             wait (0.2);
00023             
00024             //Zurück
00025             
00026             led=0x0;        //LED **** 0000
00027             wait (0.2);
00028             led=0x8;        //LED X*** 1000
00029             wait (0.2);
00030             led=0x4;        //LED *X** 0100
00031             wait (0.2);
00032             led=0x2;        //LED **X* 0010
00033             wait (0.2);
00034             led=0x1;        //LED ***X 0001
00035             wait (0.2);
00036             led=0x0;        //LED **** 0000
00037             wait (0.2);
00038             
00039         }
00040 }
00041 // **** ENDE ****