|
光电编码器程序 计算速度那个没看懂 求指点 60000/26 什么意思?
void time0()interrupt 1
{
TL0=(65536-1000)%256;
TH0=(65536-1000)/256;
c++;
if(Speed == 0 && inFlag == 0)
{
MBuf[MBuf_i] = (60000/26)/c; //计算速度
c = 0;
inFlag = 1; //重置
MBuf_i = (MBuf_i+1)%sizeof(MBuf);
}
else if(Speed==1 && inFlag==1)
{
inFlag=0;
}
}
|
|