M0_Übung_2g

Dependencies:   mbed

Fork of M0_Lektion02g 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 int I;
00008 
00009 // **** HAUPTPROGRAMM ****
00010 
00011 int main() {
00012     while(1) 
00013         {
00014             I=0;
00015             led=0x800;          //LED   0000 0000 0001
00016             for (I=0;I<12;I=I++) // Schleife von i=0; solange i kleiner als 12;
00017                                  // erhöhe i bei jedem Durchgang um 1
00018             {
00019                 wait(0.2);
00020                 led=led<<2;      // verschiebe das BIT um eins Richtung MSB
00021             }
00022             
00023         }
00024 }
00025 // **** ENDE ****