智能可遥控小车-毕业论文 - 图文 下载本文

start:

jnb p2.3,start acall delay jnb p2.3,start

jb p2.4,redf ;跳转红外控制模式 mov speed,#07h setb tr0 mov timerk,#01h call delaa call delaa call delaa call delaa call delaa jiance:

mov c,p2.0 mov 22h,c mov c,p2.1 mov 23h,c mov c,p2.2 mov 24h,c mov c,p2.3 mov 25h,c mov c,p2.4 mov 26h,c zhangai:

jb 25h,stop jnb 22h,tr jnb 23h,tr jnb 24h,tl jnb 26h,tl ajmp jiance tl:

clr p0.5 clr p0.4 mov speed,#05h acall delaa

29

setb p0.4 setb p0.5 mov speed,#07h ajmp jiance tr:

clr p0.6 clr p0.7 mov speed,#05h acall delaa setb p0.7 setb p0.6 mov speed,#07h ajmp jiance stop:

acall delay jnb 25h,zhangai clr tr0 mov a,bdm mov fenmc,a mov a,#02h add a,fenmc mov fenmc,a here: cjne a,bdm,here clr tr1 setb p2.6 acall delaa setb p2.7 ajmp $ st0:

push acc push psw mov th0,#3ch mov tl0,#0b0h inc final mov a,#0ah cjne a,final,out

30

mov final,#00h inc zhodu mov a,#02h cjne a,zhodu,miepo mov point,#0bh mov zhodu,#00h inc sec mov a,#0ah cjne a,sec,out mov sec,#00h inc msec mov a,#06h cjne a,msec,out mov msec,#00h inc min mov a,#0ah cjne a,min,out mov min,#00h inc tenmin out:

call display outb: pop psw pop acc reti miepo:

mov point,#0ah ajmp out st1:

push acc push psw inc zhon mov a,speed cjne a,zhon,hig setb p2.7 ajmp outi

31

hig:

mov a,#0ah cjne a,zhon,outi mov zhon,#00h clr p2.7 outi:

mov a,#01h cjne a,timerk,outb jb p2.5,gao mov c,p2.5 mov 21h,c orl c,20h clr 20h jc youbh ajmp outb gao:

setb 20h ajmp outb youbh:

inc plus mov a,carryb cjne a,plus,outb mov plus,#00h inc bhcs mov a,#02h cjne a,bhcs,jici mov carryb,#03h goon:inc bcm mov a,#0ah cjne a,bcm,out mov bcm,#00h inc bdm cjne a,bdm,out mov bdm,#00h inc meter cjne a,meter,out

32