#include
unsignedcharcodef_rotaTIon[4]={0x02,0x04,0x08,0x10};//正转表格
unsignedcharcodeb_rotaTIon[4]={0x10,0x08,0x040,0x02};//回转表格
voiddelay(unsignedinTI)//延时
{
while(–i);
}
main()
{
unsignedchari;
while(1)
{
for(i=0;i《4;i++)//4相
{
p1=f_rotaTIon[i];//输出对应的相能够自行换成回转表格
delay(10000);//改动这个参数能够调整电机转速
}
}
}