const Uint16 StepMode1[8] = {0x0D0A,0x0D0A,0x0A0B,0x0A0B,0x0B0C,0x0B0C,0x0C0D,0x0C0D};
const Uint16 StepMode2[8] = {0xCDAB,0xDABC,0xABCD,0xBCDA,0xCDAB,0xDABC,0xABCD,0xBCDA};
const Uint16 StepMode3[8] = {0x0D0A,0x0DAB,0x0A0B,0x0ABC,0x0B0C,0x0BCD,0x0C0D,0x0CDA};
void MotionControl1(void)
{
Uint16 loop = 0;
for(loop = 0;loop<=7;loop++)
{
PhaseOn (StepMode1[loop] & 0x000F); //第一位:控制信号高电平判断
PhaseOn ((StepMode1[loop] & 0x00F0)>>4); //第二位:控制信号高电平判断
PhaseOff((StepMode1[loop] & 0x0F00)>>8); //第三位:控制信号低电平判断
PhaseOff((StepMode1[loop] & 0xF000)>>12); //第四位:控制信号低电平判断
delay(STEP_TIME);
}
}
我看不懂单四拍控制时序是怎么循环的?怎么从A-B-C-D-A的?这个的结果为什么是B,谢谢啦! |