void Avoid(){ while(S < 400)//小于避障距离就停车同时报警 { beep = 0;//使能蜂鸣器 stop();//停车 } beep = 1;//一直到移除障碍,则关闭蜂鸣器报警回到主程序。}