教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 精品文档 > 基础教育 >

89c52的单片机自动往返电动小汽车设计报告 - 图文(5)

来源:网络收集 时间:2026-05-25
导读: if (SelectedSpeed==Normal) { DisplayString(0x0,0,\); DisplayString(0x0,1,\); Delay(50); WriteCmd(LCD_CLS); } if (SelectedSpeed==Low) { DisplayString(0x0,0,\); DisplayString(0x0,1,\); Delay(50); Write

if (SelectedSpeed==Normal) { DisplayString(0x0,0,\); DisplayString(0x0,1,\); Delay(50); WriteCmd(LCD_CLS);

}

if (SelectedSpeed==Low) { DisplayString(0x0,0,\); DisplayString(0x0,1,\); Delay(50); WriteCmd(LCD_CLS);

}

if (SelectedSpeed==High) { DisplayString(0x0,0,\); DisplayString(0x0,1,\); Delay(50); WriteCmd(LCD_CLS);

}

}

INTInit(); DisplayString(0x0,0,\); while (ReadyToGo--) DisplaySingleChar(0x7,1,ReadyToGo+0x30); DisplaySingleChar(0x09,1,'s'); Delay(300);

}

WriteCmd(LCD_CLS);

DisplayString(0x05,0,\); Delay(100); WriteCmd(LCD_CLS);

DisplayString(0x0,0,\); DisplayString(0x0,1,\);

if (SelectedMode==Line&&AutoMode==0)

flag=Area0; else flag=1;

16

//初始化所有中断

{

while(flag<5) {

if(AutoMode==1) }

{

switch(PassLineID) case 0 :{

if(IsT0INT==1)

{P01=P02=P04=0;P03=1;} {P01=P02=P03=P04=0;}

}break;

{

else

case 1 :{

P01=P02=P03=0;P04=1; }break; case 2 :{

P01=P02=P04=0;P03=1;

}break; default :break;

}

else {

if(SelectedMode==Line)

flag=Area0; if(IsT0INT==1)

{P03=1;P04=0;P01=P02=0;} else

{P03=0;P04=0;P01=P02=0;}

{

}

else {

{

if((Nocurve<2)&&Round!=0&&(Back0>0)&&Back!=0)

if(Backid==1)

{P01=1;P02=0;P03=0;P04=1;}

else

{P01=0;P02=1;P03=0;P04=1;}

Back=1; else

}

{

if(Round==0)

17

}

{

if(IsT0INT2==1)

{P01=0;P02=0;P03=1;P04=0;} {P01=0;P02=0;P03=0;P04=0;} else

}

else {

if(P33==0) {

if(IsT0INT2==1)

{P01=0;P02=0;P03=1;P04=0;} else

{P01=0;P02=0;P03=0;P04=0;}

} else

EX1=1; if(Round%2) {

if(IsT0INT2==1)

{

{P01=1;P02=0;P03=1;P04=0;Backid=1;}

{P01=1;P02=0;P03=0;P04=0;}

} else {

if(IsT0INT2==1) else

else

{P01=0;P02=1;P03=1;P04=0;Backid=0;}

{P01=0;P02=1;P03=0;P04=0;}

}

}

}

} } }

if (IsT1INT==1) { }

IsT1INT=0; ComputeTime();

ComputeSpeedANDDistance();

18

//补中断路程,加上最后一次中断缺失的路程 ComputeSpeedANDDistance(); P04=1;P03=0;P01=P02=0;Delay(90); P03=0;P04=0; P31=1;

ET0=0x0; ET1=0x0; EX1=0x01;

AutoDisplay=True; WriteCmd(LCD_CLS);

if (SelectedMode==Line)

while(1) {

if (GoToChoosingDisplay==True)

break; Delay(200); WriteCmd(LCD_CLS); Delay(200);

DisplayString(0,0,\); DisplayString(0,1,\); DisplaySingleChar(0x0C,1,'s');

89c52的单片机自动往返电动小汽车设计报告 - 图文(5).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/wendang/565337.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)