if (new&0x01) /*(初始new=0x03;)设定转速后new=0x01*/
{new&=0xfe;i=0; /*将new清零*/
display[4]=1;
display[0]=0;
need=1; /*数码显示更新标志,下次循环时,将改变数码管显示的值*/
temp=r1;
while (temp!=0) /*将个、十……为依次放入数组display[i]的前几位*/
{display[i]=temp-(int)(temp/10)*10;
temp=(int)(temp/10);i++;
};
if(i==0) i=1;
display[6]=i; /*数组的第六位代表所存数字的位数*/
};
if (num==2) /*0102――动态显示设置电机转速的过程*/
{if (new&0x08) /*设置速度时new=0x88*/
{need=1;new=0x80; /*显示更新标志need置1*/
/*将new置0x80,防止设置间隙时,此段程序继续执行,提高效率*/
display[4]=2;
display[0]=0x40; /*?*/
temp=bri;i=0;
while (t
首页 上一页 2 3 4 5 6 7 8 下一页 尾页 5/13/13
实验一转速测量与控制(五)由毕业论文网(www.huoyuandh.com)会员上传。