void UPUP(void) { unsigned int i = 128; while(i--){ Coil_A1 delay(Speed); Coil_AB1 //遇到Coil_AB1 用{A1=1;B1=1;C1=0;D1=0;}代替 delay(Speed); //改变这个参数可以调整电机转速 Coil_B1 //数字越小,转速越大,力矩越小 delay(Speed); Coil_BC1 delay(Speed); Coil_C1 delay(Speed); Coil_CD1 delay(Speed); Coil_D1 delay(Speed); Coil_DA1 delay(Speed); Coil_OFF } }写一个类似步进电机反转的代码
时间: 2023-06-02 18:02:13 浏览: 146
up_down_cntr.rar_UP_up-down counter_up/down counter
void DOWNDOWN(void) { unsigned int i = 128; while(i--){ Coil_D1 delay(Speed); Coil_DA1 //遇到Coil_DA1 用{A1=0;B1=0;C1=1;D1=1;}代替 delay(Speed); //改变这个参数可以调整电机转速 Coil_C1 //数字越小,转速越大,力矩越小 delay(Speed); Coil_BC1 delay(Speed); Coil_B1 delay(Speed); Coil_AB1 delay(Speed); Coil_A1 delay(Speed); Coil_OFF } }
阅读全文