谁能给我一份跑马灯汇编程序?
答案:1 悬赏:80 手机版
解决时间 2021-05-01 14:56
- 提问者网友:謫仙
- 2021-05-01 08:33
要求单片机89C2051或者51来顺序执行每一个LED在间隔一秒钟的跑马,然后全部点亮五秒钟。谢谢
最佳答案
- 五星知识达人网友:怀裏藏嬌
- 2021-05-01 10:12
<html>
<head>
<script Language="JavaScript">
var msg="这是一个跑马灯效果的JavaScript文档";
var interval = 100;
var spacelen = 120;
var space10=" ";
var seq=0;
function Scroll() {
len = msg.length;
window.status = msg.substring(0, seq+1);
seq++;
if ( seq >= len ) {
seq = spacelen;
window.setTimeout("Scroll2();", interval );
}
else
window.setTimeout("Scroll();", interval );
}
function Scroll2() {
var out="";
for (i=1; i<=spacelen/space10.length; i++) out +=
space10;
out = out + msg;
len=out.length;
window.status=out.substring(seq, len);
seq++;
if ( seq >= len ) { seq = 0; };
window.setTimeout("Scroll2();", interval );
}
Scroll();
</script>
<body>
</body>
</html>
<head>
<script Language="JavaScript">
var msg="这是一个跑马灯效果的JavaScript文档";
var interval = 100;
var spacelen = 120;
var space10=" ";
var seq=0;
function Scroll() {
len = msg.length;
window.status = msg.substring(0, seq+1);
seq++;
if ( seq >= len ) {
seq = spacelen;
window.setTimeout("Scroll2();", interval );
}
else
window.setTimeout("Scroll();", interval );
}
function Scroll2() {
var out="";
for (i=1; i<=spacelen/space10.length; i++) out +=
space10;
out = out + msg;
len=out.length;
window.status=out.substring(seq, len);
seq++;
if ( seq >= len ) { seq = 0; };
window.setTimeout("Scroll2();", interval );
}
Scroll();
</script>
<body>
</body>
</html>
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯