tgs0910
|
分享:
▲
ORG 0H LOOP: MOV P0,#07EH CALL DELAY1 MOV P0,#0BDH CALL DELAY1 MOV P0,#0DBH CALL DELAY1 MOV P0,#0E7H CALL DELAY1 ; 8個LED一開始兩側向內三次; MOV P0,#0FFH CALL DELAY1 MOV P0,#000H CALL DELAY1 MOV P0,#0FFH CALL DELAY1 MOV P0,#000H CALL DELAY1 MOV P0,#0FFH CALL DELAY1 MOV P0,#000H CALL DELAY1 ; 全亮,閃爍三次; MOV P0,#03FH CALL DELAY2 MOV P0,#0CFH CALL DELAY2 MOV P0,#0F3H CALL DELAY2 MOV P0,#0FCH CALL DELAY2 ; 速度加快由左至右,每次亮2燈 ; MOV P0,#0FFH CALL DELAY2 MOV P0,#000H CALL DELA2 MOV P0,#0FFH CALL DELAY2 MOV P0,#000H CALL DELAY2 ; 兩次全亮,閃兩次 ; MOV P0,#0F3H CALL DELAY3 MOV P0,#0FCH CALL DELAY3 MOV P0,#03FH CALL DELAY3 MOV P0,#0CFH CALL DELAY3 ; 速度加快由右至左,每次亮2燈 ; MOV P0,#0FFH CALL DELAY3 MOV P0,#000H CALL DELAY3 MOV P0,#0FFH CALL DELAY3 MOV P0,#000H CALL DELAY3 ; 兩次全亮,閃兩次 ; AJMP LOOP
DELAY1: MOV R7,#200 Dly1: MOV R6,#100 Dly2: DJNZ R6,Dly2 DJNZ R7,Dly1 DJNZ R5,DELAY1 RET
DELAY2: MOV R7,#100 Dly3: MOV R6,#100 Dly4: DJNZ R6,Dly4 DJNZ R7,Dly3 DJNZ R5,DELAY2 RET
DELAY3: MOV R7,#300 Dly5: MOV R6,#100 Dly6: DJNZ R6,Dly6 DJNZ R7,Dly5 DJNZ R5,DELAY3 RET END
|