⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 花样流水灯.txt

📁 这个是自己编的流水灯的例子
💻 TXT
字号:
本程序由购买本学习板的客户‘过客-QQ2407191’在学习过程中编写:

1、还可以8个灯,4个正向,4个反向较差熄灭 
clr p1.7
loop:
setb p0.0
lcall dely
setb p0.1
lcall dely
setb p0.2
lcall dely
setb p0.3
lcall dely
setb p0.4
lcall dely
setb p0.5
lcall dely
setb p0.6
lcall dely
setb p0.7
lcall dely

mov p0,#00H
lcall dely
ajmp loop

dely:mov r6,#250
D1:mov r5,#250
D2:djnz r5,d2
djnz r6,d1
ret
end


2、
 依次点亮,再依次熄灭
clr p1.7
loop:
clr p0.0
lcall dely
clr p0.1
lcall dely
clr p0.2
lcall dely
clr p0.3
lcall dely
clr p0.4
lcall dely
clr p0.5
lcall dely
clr p0.6
lcall dely
clr p0.7
lcall dely
setb p0.7
lcall dely
setb p0.6
lcall dely
setb p0.5
lcall dely
setb p0.4
lcall dely
setb p0.3
lcall dely
setb p0.2
lcall dely
setb p0.1
lcall dely
setb p0.0
lcall dely
ajmp loop

dely: mov r6,#250
D1:mov r5,#250
D2:djnz r5,d2
djnz r6,d1
ret
end

过客 2008-04-22 19:37:26
clr p1.7
loop:
setb p0.6
lcall dely
setb p0.4
lcall dely
setb p0.2
lcall dely
setb p0.0
lcall dely

setb p0.1
lcall keke
setb p0.3
lcall keke
setb p0.5
lcall keke
setb p0.7
lcall keke
mov p0,#00H
lcall dely
ajmp loop

dely:mov R7,#250
D1:mov R6,#250
D2:djnz r6,d2
djnz r7,d1
ret

keke:mov R5,#250
V1:mov R4,#250
V2:djnz r4,v2
djnz r5,v1
ret
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -