初级会员

- 积分
- 80
- 金钱
- 80
- 注册时间
- 2017-10-18
- 在线时间
- 14 小时
|
5金钱
void UART2_ReportIMU(int16_t yaw,int16_t pitch,int16_t roll
,int16_t alt,int16_t tempr,int16_t press,int16_t IMUpersec)
{
unsigned int temp=0xaF+2+2;
char ctemp;
UART2_Put_Char(0xa5);
UART2_Put_Char(0x5a);
UART2_Put_Char(14+4);
UART2_Put_Char(0xA1);
if(yaw<0)yaw=32768-yaw;
ctemp=yaw>>8;
UART2_Put_Char(ctemp);
temp+=ctemp;
ctemp=yaw;
UART2_Put_Char(ctemp);
temp+=ctemp;
if(pitch<0)pitch=32768-pitch;
ctemp=pitch>>8;
UART2_Put_Char(ctemp);
temp+=ctemp;
ctemp=pitch;
UART2_Put_Char(ctemp);
temp+=ctemp;
if(roll<0)roll=32768-roll;
ctemp=roll>>8;
UART2_Put_Char(ctemp);
temp+=ctemp;
ctemp=roll;
UART2_Put_Char(ctemp);
temp+=ctemp;
if(alt<0)alt=32768-alt;
ctemp=alt>>8;
UART2_Put_Char(ctemp);
temp+=ctemp;
ctemp=alt;
UART2_Put_Char(ctemp);
temp+=ctemp;
if(tempr<0)tempr=32768-tempr;
ctemp=tempr>>8;
UART2_Put_Char(ctemp);
temp+=ctemp;
ctemp=tempr;
UART2_Put_Char(ctemp);
temp+=ctemp;
if(press<0)press=32768-press;
ctemp=press>>8;
UART2_Put_Char(ctemp);
temp+=ctemp;
ctemp=press;
UART2_Put_Char(ctemp);
temp+=ctemp;
ctemp=IMUpersec>>8;
UART2_Put_Char(ctemp);
temp+=ctemp;
ctemp=IMUpersec;
UART2_Put_Char(ctemp);
temp+=ctemp;
UART2_Put_Char(temp%256);
UART2_Put_Char(0xaa);
}
程序中unsigned int temp=0xaF+2+2;是什么了,为什么等于0xaF+2+2?
|
|