基于双核多接口的智能汽车控制系统设计
Value=Gyro_Data_BUF[i];
本文引用地址:https://www.eepw.com.cn/article/97039.htmSum+=Value;
if(Max
Max=Value;
if(Min>Value)
Min=Value;
}
Sum= Sum-Max-Min ;
SUM_Test = Sum;
CarAngel_V=((((signed long)(Sum/10)- (signed long)Gyro_MidValue)*10000)>>16);
/限幅处理/
if(CarAngel_V > 0)
{
CarAngel_V = (CarAngel_V *
1013) / 1000;
}
if(CarAngel_V<0)
{
CarAngel_V = (CarAngel_V *
1004)/ 1000;
}
if(CarAngel_V>32767)
{
CarAngel_V=32767;
}
if(CarAngel_V<-32767)
{
CarAngel_V=-32767;
}
if(Gyro_Calibration_Flag == 1)
CarAngelRate = (unsigned int)
(CarAngel_V + 32767);
else
CarAngelRate = 32767;
}
}
伺服电机相关文章:伺服电机工作原理
评论