void main()
{
Timer_Init();
while (1)
{
do
{
Car_Run ();
a = Front_Ju_Li ();
}while(a >= 20);
Car_Stop ();
b = Zuo_Ju_Li ();
Delay(100);
c = You_Ju_Li ();
Delay(100);
if (b <= 15 && c <= 15) //進入狹小空間,后退
Car_Houtui ();
if (b <= c) //左邊距離小于右邊距離,右轉(zhuǎn)
Car_Youzhuan ();
if (c <= b) /右邊距離小于左邊距離,左轉(zhuǎn)
Car_Zuozhuan ();
else
Car_Stop ();