ec0e6e3491dfb562
获得 0 次赞
帮助过0人
高手看一下,下面这程序我想让步进电机正转10-15秒后再反转10-15秒再正转,周而复始。程序需要怎样修改?谢谢!/@@*1、本程序用于测试4相步进电机常规驱动 2、需要用跳帽或者杜邦线把信号输出端和对应的步进电机信号输入端连接起来3、速度不可以调节的过快,不然就没有力矩转动了可以按照给的原理图接线*/#include <reg52.h>unsigned char code F_Rotation[4]={0x040x080x100x20};//正转表格unsigned char code B_Rotation[4]={0x200x100x080x04};//反转表格void Delay(unsigned int i)//延时{ while(--i);}main(){ unsigned char i; while(1) { for(i=0;i<4;i++) //4相 { P3=F_Rotation[ i]; //输出对应的相 可以自行换成反转表格 Delay(750*10); //改变这个参数可以调整电机转速 } }}