?? pwmdeng.asm
字號:
deng bit p1.7
time1 data 3ah
time2 data 3bh
org 00h
ajmp start
org 40h
start: mov time1,#00h
mov time2,#171
loop1:
inc time1
dec time2
mov a,time1
cjne a,#170,next1
ajmp next2
next1: setb deng
mov r1,time1
call delay
clr deng
mov r1,time2
call delay
ajmp loop1
next2: SETB DENG
CALL DELAY
CALL DELAY
; CALL DELAY
; CALL DELAY
mov time1,#200
mov time2,#00h
loop2: setb deng
dec time1
inc time2
mov a,time1
jz next3
mov r1,time1
call delay
clr deng
mov r1,time2
call delay
ajmp loop2
next3: CLR DENG
mov r1,#255
call delay
mov r1,#255
call delay
CALL DELAY
CALL DELAY
AJMP START
DELAY: MOV R2,#2
DE1: MOV R3,#35
DJNZ R3,$
DJNZ R2,DE1
DJNZ R1,DELAY
RET
END
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -