51单片机第一个灯亮,第三个灯亮,第五个灯亮,第七个灯亮,每个灯亮

2025-04-04 13:36:52
推荐回答(1个)
回答1:

FMQ EQU P1.0
LED EQU P0
ORG 0000H
LJMP MAIN
ORG 0030H
MAIN:
MOV A,#0FEH
MOV R2,#4
LOOP:
MOV LED,A
LCALL DELAY
DJNZ R2,LOOP
MOV LED,#00H
CLR FMQ
LCALL DELAY
SJMP MAIN
DELAY:
MOV R2,#250
DLY:
MOV R3,#250
DJNZ R3,$
DJNZ R2,DLY
RET
END