/*******************************步进电机驱动***********************/ if (Stepper_Motor_On&&Stepper_Motor_Out) { Stepper_Motor_Out=0; if (Motor_Dir==0) { switch (_Step) { case 0: Motor_A = 1; Motor_B = 1; Motor_C = 0; Motor_D = 0; _Step=1; break; case 1: Motor_A = 0; Motor_B = 1; Motor_C = 1; Motor_D = 0; _Step=2; break; case 2: Motor_A = 0; Motor_B = 0; Motor_C = 1; Motor_D = 1; _Step=3; break; case 3: Motor_A = 1; Motor_B = 0; Motor_C = 0; Motor_D = 1; _Step=0; Changed_Rrhythm_Step++; break; default: break; } } if (Motor_Dir==1) { switch (_Step) { case 0: Motor_A = 1; Motor_B = 0; Motor_C = 0; Motor_D = 1; _Step=1; break; case 1: Motor_A = 0; Motor_B = 0; Motor_C = 1; Motor_D = 1; _Step=2; break; case 2: Motor_A = 0; Motor_B = 1; Motor_C = 1; Motor_D = 0; _Step=3; break; case 3: Motor_A = 1; Motor_B = 1; Motor_C = 0; Motor_D = 0; _Step=0; Changed_Rrhythm_Step--; break; default: break; } } } /*******************************步进电机驱动END***********************/