资源简介
dhe0ug.rar
代码片段和文件信息
#include
#include
#define uchar unsigned char
#define uint unsigned int
sbit PB0=P2^0;
sbit PB1=P2^1;
sbit PB2=P2^2;
sbit SPK=P2^3;
sbit L1=P3^4;
sbit L2=P3^5;
sbit R1=P3^6;
sbit R2=P3^7;
sbit leftlight=P1^0;
sbit middlight=P1^1;
sbit rightlight=P1^2;
sbit ctrlA = P1^4;
sbit ctrlB = P1^5;
sbit ctrlC = P1^6;
sbit ctrlD = P1^7;
uchar code laydown[]={“laying down “};
uchar code seached[]={“Seached light “};
uchar code seaching[]={“Seaching light “};
uchar code start[]={“Start! “};
uchar code finish[]={“Finished!!! “};
uchar code go[]={“GO!GO!GO! “};
uchar code leftside[]={“Left Side !! “};
uchar code rightside[]={“Right Side !! “};
uchar code waiting[]={“waiting start “};
uchar code ctrlmode[]={“Ctrl Mode “};
uint times = 0;
uint count = 0;
uchar comd=0comdtime = 0comdopen = 0;
uchar step=1;
uchar blackline=0;
void displaytimer(n)
{ uchar geshi;
ge=n%10;shi=n/10;
display_lcd_byte(014number[shi]);
display_lcd_byte(015number[ge]);
}
void displaycomd(n)
{
display_lcd_byte(115number[n]);
}
void leftup()
{
L1 = 0;
L2 = 1;
delay(40);
L2= 0;
delay(50);
}
void leftback()
{
L2 = 0;
L1 = 1;
delay(40);
L1= 0;
delay(50);
}
void rightup()
{
R1 = 0;
R2 = 1;
delay(40);
R2= 0;
delay(50);
}
void rightback()
{
R2 = 0;
R1 = 1;
delay(40);
R1= 0;
delay(50);
}
void allstop()
{
R1=R2=L1=L2=0;
}
void moveup()
{
L1=R1=0;
L2=R2=1;
delay(40);
L2=R2=0;
delay(20);
}
void moveback()
{
L1=R1=1;
L2=R2=0;
}
void speaker(n)
{
SPK=1;
delay(n);
SPK=0;
}
uchar firstseachlight()
{
while(middlight != 0)
{ while(leftlight == 0)
{
allstop();
rightup();
// display_lcd_text(10leftside);
}
while(rightlight == 0)
{ allstop();
leftup();
// display_lcd_byte(00‘R‘);
display_lcd_text(10rightside);
}
if(leftlight != 0 && rightlight != 0)
{
allstop();
rightup();
// display_lcd_text(10seaching);
}
}
if(middlight == 0 && leftlight != 0 && rightlight != 0)
{
display_lcd_text(10seached);
return 1;
}
else return 0;
}
/***********************************************
uchar seachlight()
{
while(middlight != 0)
{ while(rightlight == 0)
{
allstop();
rightup();
display_lcd_text(10leftside);
}
while(leftlight == 0)
{ allstop();
leftup();
// display_lcd_byte(00‘R‘);
display_lcd_text(10rightside);
}
}
if(middlight == 0 && leftlight != 0 && rightlight != 0)
{
display_lcd_text(10seached);
return 1;
}
else return 0;
}
***********************************************/
void InitTimer0(void) //定时1ms
{
TMOD = 0x01;
TH0 = 0x0FC;
TL0 = 0x18;
EA = 1;
ET0 = 1;
// TR0 = 1;
}
main()
{
uchar ctrlkey=0;
IE = 0x83;
TCON = 0X05;
IP = 0x02;
LCD1602();
init();
SPK=0;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 179065 2012-06-19 16:03 寻光小车\Backup of CONTROL
文件 29260 2012-06-18 23:03 寻光小车\Backup of CONTROL.Sch
文件 63950 2012-06-18 22:32 寻光小车\Backup of GM.PCB
文件 52884 2012-11-17 00:14 寻光小车\Backup of PCB1.PCB
文件 28866 2012-06-13 13:31 寻光小车\Backup of RPR220.Sch
文件 6495 2012-06-13 23:32 寻光小车\Backup of Sheet1.Sch
文件 8431 2012-06-18 22:32 寻光小车\Backup of 光敏二极管 .Sch
文件 17566 2012-07-02 18:01 寻光小车\code\control
文件 4371 2012-07-02 18:01 寻光小车\code\control.hex
文件 43 2012-07-02 18:01 寻光小车\code\control.lnp
文件 23833 2012-07-02 18:01 寻光小车\code\control.M51
文件 13386 2012-07-02 18:03 寻光小车\code\control.plg
文件 142879 2012-07-02 18:03 寻光小车\code\control.uvopt
文件 13234 2012-06-22 05:07 寻光小车\code\control.uvproj
文件 142879 2012-07-02 18:03 寻光小车\code\control_uvopt.bak
文件 13225 2012-06-18 17:07 寻光小车\code\control_uvproj.bak
文件 4829 2012-07-02 18:01 寻光小车\code\main.c
文件 13124 2012-07-02 18:01 寻光小车\code\main.LST
文件 20208 2012-07-02 18:01 寻光小车\code\main.OBJ
文件 3916 2012-06-23 08:44 寻光小车\code\main0.txt
文件 2417 2011-06-18 16:21 寻光小车\code\my 1602.H
文件 4104 2012-06-23 09:43 寻光小车\code\初步完成.txt
文件 3207 2012-06-23 11:00 寻光小车\code\完成.txt
文件 179055 2012-06-18 23:03 寻光小车\Previous Backup of CONTROL
文件 29270 2012-06-18 22:32 寻光小车\Previous Backup of CONTROL.Sch
文件 63581 2012-06-15 16:50 寻光小车\Previous Backup of GM.PCB
文件 53387 2012-06-14 22:31 寻光小车\Previous Backup of PCB1.PCB
文件 5928 2012-06-13 13:10 寻光小车\Previous Backup of RPR220.Sch
文件 6479 2012-06-13 15:27 寻光小车\Previous Backup of Sheet1.Sch
文件 8458 2012-06-15 14:23 寻光小车\Previous Backup of 光敏二极管 .Sch
............此处省略29个文件信息
相关资源
- 88npkv.doc
- 前端跳槽面试必备技巧.docx
- license_quartus8.1.rar
- B-Human添加module与representation.pdf
- B-Human校准命令.pdf
- B-Human命令总结.pdf
- permutationentropy.rar
- 百度云盘.txt
- VoiceRecorder.rar
- ws.zip
- 4360GoogleAVA数据集百度云地址及相关介
- arithmetic.rar
- 省市区商圈数据库.rar
- 多目标跟踪MOT_2DMOT2015数据集.txt
- 王者荣耀资源.txt
- licenceForVivado.7z
- Shapes.rar
- 上位机.txt
- 各种网站模板87G资源.txt
- Web前端面试指南与高频考题解析掘金
- 新建文本文档.zip
- 韩顺平ssm视频百度云链接.txt
- 程序员电子书包.txt
- 百度云分享码.txt
- 网页模板.txt
- Quartus17.1.txt
- 疫情地图.zip
- 下载网盘.txt191763
- DDOSAttack.zip
- 29期-淘淘商城-百度云盘.txt
评论
共有 条评论