中型无刷,标准版本带传动,蜗轮蜗杆传动比80,增加水平角度异常处理
This commit is contained in:
parent
d383b1e5ac
commit
a179e099b9
|
@ -2882,18 +2882,27 @@ static char ptz_hori_get_angle_a()
|
||||||
// tem4 = tem4 + 360.0;
|
// tem4 = tem4 + 360.0;
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
if(tem4 == 360.0)///////˝âžöźČĎÔĘž360ÓÖĎÔĘž˝ÇśČ0ľÄÎĘĚâ
|
//避免出现异常
|
||||||
|
for(uint8_t i = 0; i < 3; i++)
|
||||||
{
|
{
|
||||||
tem4 = 0;
|
if(tem4 == 360.0)///////解决既显示360又显示角度0的问题
|
||||||
}
|
{
|
||||||
if(tem4 < 0)
|
tem4 = 0;
|
||||||
{
|
}
|
||||||
tem4 = tem4 + 360.0;
|
else if( tem4 < 0 )
|
||||||
}
|
{
|
||||||
if(tem4>360.0)
|
tem4 = tem4 + 360.0;
|
||||||
{
|
}
|
||||||
tem4 = tem4 - 360.0;
|
else if( tem4 > 360.0 )
|
||||||
|
{
|
||||||
|
tem4 = tem4 - 360.0;
|
||||||
|
}
|
||||||
|
if (tem4 >=0 && tem4 <= 360.0)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g_ptz.hori_angle_actual = tem4;
|
g_ptz.hori_angle_actual = tem4;
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue