Disini saya akan membahas kembali program seven segmen , yaitu membuat program " display name berkedip ".
langsung saja :
ORG 0H
START:CLR P3.5
CLR P3.6
CLR P3.7
MOV P0,#11001110B
CALL DELAY
SETB P3.5
CLR P3.6
CLR P3.7
MOV P0,#11111001B
CALL DELAY
CLR P3.5
SETB P3.6
CLR P3.7
MOV P0,#10001000B
CALL DELAY
SETB P3.5
SETB P3.6
CLR P3.7
MOV P0,#10100001B
inc r7
Acall DELAY
CJNE R7,#30,START
mov r7,#1
sjmp off
OFF: MOV P0,#11111111B
CALL TUNDA
Ljmp START
DELAY : MOV R0,#5
DEL1 : MOV R1,#25
DEL2 : MOV R2,#25
DJNZ R2,$
DJNZ R1,DEL2
DJNZ R0,DEL1
ret
TUNDA: mov R0,#225
TUN1: mov R1,#225
TUN2: djnz R1,TUN2
djnz R0,TUN1
ret
end
Tidak ada komentar:
Posting Komentar