#includereg52.hsbitLED1=P0^0;sbitDJ=P0^0;sbitkey1=P0^1;sbitkey2=P0^2;sbitkey3=P0^3;sbitkey4=P0^4;sbitkey5=P0^5;voidDelay05ms()//@24.000MHz{unsignedchari,j;i=2;j=239;do{while(--j);}while(--i);}voidDelay175ms()//@24.000MHz{unsignedchari,j;i=69;j=20;do{while(--j);}while(--i);}voidDelay18ms()//@24.000MHz{unsignedchari,j;i=71;j=6;do{while(--j);}while(--i);}voidDelay185ms()//@24.000MHz{unsignedchari,j;i=72;j=249;do{while(--j);}while(--i);}voidDelay19ms()//@24.000MHz{unsignedchari,j;i=74;j=235;do{while(--j);}while(--i);}voidright45(){while(1){DJ=1;Delay05ms();Delay05ms();DJ=0;Delay19ms();if(key4!=0){Delay05ms();if(key4!=0)break;}}}voidright90(){while(1){DJ=1;Delay05ms();DJ=0;Delay19ms();Delay05ms();if(key4!=0){Delay05ms();if(key4!=0)break;}}}voidleft45(){while(1){DJ=1;Delay05ms();Delay05ms();Delay05ms();Delay05ms();DJ=0;Delay18ms();if(key2!=0){Delay05ms();if(key2!=0)break;}}}voidleft90(){while(1){DJ=1;Delay05ms();Delay05ms();Delay05ms();Delay05ms();Delay05ms();DJ=0;Delay175ms();if(key5!=0){Delay05ms();if(key5!=0)break;}}}voidmiddle(){while(1){DJ=1;Delay05ms();Delay05ms();Delay05ms();DJ=0;Delay185ms();if(key3!=0){Delay05ms();if(key3!=0)break;}}}voidmain(){while(1){if(key1==0)left90();if(key2==0)left45();if(key3==0)middle();if(key4==0)right45();if(key5==0)right90();}}