DIY编程器网

标题: 8路LED跑马灯电路图 [打印本页]

作者: liyf    时间: 2011-4-29 20:05
标题: 8路LED跑马灯电路图
8路LED跑马灯电路图

ajmp loop
org 0080h ;到0030h处避开00-30的敏感地址
loop:
mov p1,#0ffh ;关闭所有灯
clr p1.0 ;点亮灯p1.0
lcall delay ;延时一段时间?
clr p1.1 ;点亮灯p1.1
lcall delay
clr p1.2 ;点亮灯p1.2
lcall delay
clr p1.3 ;点亮灯p1.3
lcall delay
clr p1.4 ;点亮灯p1.4
lcall delay
clr p1.5 ;点亮灯p1.5
lcall delay
clr p1.6 ;点亮灯p1.6
lcall delay
clr p1.7 ;点亮灯p1.7
lcall delay
AJMP LOOP ;到最开始loop处重新运行
delay: mov r5,#20 ;延时。
d1: mov r6,#40
d2: mov r7,#248
djnz r7,$
djnz r6,d2
djnz r5,d1
ret
end







欢迎光临 DIY编程器网 (http://diybcq.com/) Powered by Discuz! X3.2