
 void Delay (long int sure) 
{ 
long int j,q; 
for (j=1;j<=sure;j++) 
for(q=0;q<=10;++q){;} 
} 

main() 
{ 
long int b; 
b=9; 
P0=0x00; 
P1=0x00; 
P2=0x00; 
P3=0x00; 
Delay(300); 

while(1){ 

P1=0x2A; 
Delay(b); 
P1=0x00; 
Delay(1); 

P1=0x0E; 
Delay(b); 
P1=0x00; 
Delay(1); 

P1=0x1C; 
Delay(b); 
P1=0x00; 
Delay(1); 

P1=0x15; 
Delay(b); 
P1=0x00; 
Delay(1); 

P1=0x31; 
Delay(b); 
P1=0x00; 
Delay(1); 

P1=0x23; 
Delay(b); 
P1=0x00; 
Delay(1); 

if (P0_0==1){b=3;} 
if (P0_1==1){b=4;} 
if (P0_2==1){b=5;} 
if (P0_3==1){b=6;} 
if (P0_4==1){b=7;} 
if (P0_5==1){b=8;} 
if (P0_6==1){b=9;} 
if (P0_7==1){b=10;} 
} 

} 
