工业控制 | 能源技术 | 汽车电子 | 通信网络 | 安防监控 | 智能电网 | 移动手持 | 无线技术 | 家用电器 | 数字广播 | 消费电子 | 应用软件 | 其他方案

8路LED跑马灯电路图

作者:sunshine0606时间:2009-08-04


org 0000h ;开始
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


关键词: 马灯 电路图

评论

技术专区