M0_Übung_2e

Dependencies:   mbed

Fork of M0_Lektion02e 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_13,P1_12,P1_7,P1_6,P1_4,P1_3,P1_1,P1_0,LED4,LED3,LED2,LED1);
00006 
00007  // **** HAUPTPROGRAMM ****
00008  
00009 int main()
00010 {
00011     while(1) 
00012         {
00013             led=0x000;        //LED **** **** **** 0000 0000 0000
00014             wait(0.2);
00015             led=0x001;        //LED **** **** ***X 0000 0000 0001     
00016             wait (0.2);
00017             led=0x003;        //LED **** **** **XX 0000 0000 0011
00018             wait (0.2);
00019             led=0x006;        //LED **** **** *XX* 0000 0000 0110
00020             wait (0.2);
00021             led=0x00c;        //LED **** **** XX** 0000 0000 1100
00022             wait (0.2);
00023             led=0x018;        //LED **** ***X X*** 0000 0001 1000
00024             wait (0.2);
00025             led=0x030;        //LED **** **XX **** 0000 0011 0000
00026             wait (0.2);
00027             led=0x060;        //LED **** *XX* **** 0000 0110 0000
00028             wait (0.2);
00029             led=0x0c0;        //LED **** XX** **** 0000 1100 0000
00030             wait (0.2);
00031             led=0x180;        //LED ***X X*** **** 1000 0000 0000 
00032             wait (0.2);
00033             led=0x300;        //LED **XX **** **** 0000 0000 0000 
00034             wait (0.2);
00035             led=0x600;        //LED *XX* **** **** 0000 0000 0000 
00036             wait (0.2);
00037             led=0xc00;        //LED XX** **** **** 0000 0000 0000 
00038             wait (0.2);
00039             led=0x800;        //LED X*** **** **** 0000 0000 0000 
00040             wait (0.2);
00041             led=0x000;        //LED **** **** **** 0000 0000 0000 
00042             wait (0.2);
00043             
00044             //Zurück
00045             
00046             led=0x000;        //LED **** **** **** 0000 0000 0000 
00047             wait (0.2);
00048             led=0x800;        //LED X*** **** **** 0000 0000 0000 
00049             wait (0.2);
00050             led=0xc00;        //LED XX** **** **** 0000 0000 0000 
00051             wait (0.2);
00052             led=0x600;        //LED *XX* **** **** 0000 0000 0000 
00053             wait (0.2);
00054             led=0x300;        //LED **XX **** **** 0000 0000 0000 
00055             wait (0.2);
00056             led=0x180;        //LED ***X X*** **** 1000 0000 0000 
00057             wait (0.2);
00058             led=0x0c0;        //LED **** XX** **** 0000 1100 0000
00059             wait (0.2);
00060             led=0x060;        //LED **** *XX* **** 0000 0110 0000
00061             wait (0.2);
00062             led=0x030;        //LED **** **XX **** 0000 0011 0000
00063             wait (0.2);
00064             led=0x018;        //LED **** ***X X*** 0000 0001 1000
00065             wait (0.2);
00066             led=0x00c;        //LED **** **** XX** 0000 0000 1100
00067             wait (0.2);
00068             led=0x006;        //LED **** **** *XX* 0000 0000 0110
00069             wait (0.2);
00070             led=0x003;        //LED **** **** **XX 0000 0000 0011
00071             wait (0.2);
00072             led=0x001;        //LED **** **** ***X 0000 0000 0001     
00073             wait (0.2);
00074             led=0x000;        //LED **** **** **** 0000 0000 0000
00075             wait(0.2);
00076             
00077         }
00078 }
00079 // **** ENDE ****