📄 并行口直接驱动led显示.htm
字号:
<P>66H </P></TD>
<TD class=style25 vAlign=top width=95></TD>
<TD class=style25 vAlign=top width=95>
<P>“ C ” </P></TD>
<TD class=style25 vAlign=top width=95>
<P>39H </P></TD>
<TD class=style25 vAlign=top width=95></TD></TR>
<TR>
<TD class=style25 vAlign=top width=95>
<P>“ 5 ” </P></TD>
<TD class=style25 vAlign=top width=95>
<P>6DH </P></TD>
<TD class=style25 vAlign=top width=95></TD>
<TD class=style25 vAlign=top width=95>
<P>“ d ” </P></TD>
<TD class=style25 vAlign=top width=95>
<P>5EH </P></TD>
<TD class=style25 vAlign=top width=95></TD></TR>
<TR>
<TD class=style25 vAlign=top width=95>
<P>“ 6 ” </P></TD>
<TD class=style25 vAlign=top width=95>
<P>7DH </P></TD>
<TD class=style25 vAlign=top width=95></TD>
<TD class=style25 vAlign=top width=95>
<P>“ E ” </P></TD>
<TD class=style25 vAlign=top width=95>
<P>79H </P></TD>
<TD class=style25 vAlign=top width=95></TD></TR>
<TR>
<TD class=style25 vAlign=top width=95>
<P>“ 7 ” </P></TD>
<TD class=style25 vAlign=top width=95>
<P>07H </P></TD>
<TD class=style25 vAlign=top width=95></TD>
<TD class=style25 vAlign=top width=95>
<P>“ F ” </P></TD>
<TD class=style25 vAlign=top width=95>
<P>71H </P></TD>
<TD class=style25 vAlign=top width=95></TD></TR></TBODY></TABLE>
<P class=style25>• 由于显示的数字 0 - 9 的字形码没有规律可循,只能采用查表的方式来完成我们所需的要求了。 这样我们按着数字 0 - 9 的顺序,把每个数字的笔段代码按顺序排好!建立的表格如下所示: TABLE DB 3FH , 06H , 5BH , 4FH , 66H , 6DH , 7DH , 07H , 7FH , 6FH </P>
<P class=style25><STRONG>5.程序框图 </STRONG><BR><a href=http://www.tengdamc.com/download/shiyanjc/images/072.jpg target=_blank><IMG height=334 src="http://www.tengdamc.com/download/shiyanjc/images/072.jpg" width=315 border='0' title='点击在新窗口查看原始图片' onload='java_script_:if(this.width>300)this.width=300'></a><STRONG></STRONG></P>
<P class=style25 align=center>图 4.7.2 </P>
<P class=style25><STRONG>6. 汇编源程序 </STRONG></P>
<P class=style25>ORG 0 </P>
<P class=style25>START: MOV R1,#00H </P>
<P class=style25>NEXT: MOV A,R1 </P>
<P class=style25>MOV DPTR,#TABLE </P>
<P class=style25>MOVC A,@A+DPTR </P>
<P class=style25>MOV P0,A </P>
<P class=style25>LCALL DELAY </P>
<P class=style25>INC R1 </P>
<P class=style25>CJNE R1,#10,NEXT </P>
<P class=style25>LJMP START </P>
<P class=style25>DELAY: MOV R5,#20 </P>
<P class=style25>D2: MOV R6,#20 </P>
<P class=style25>D1: MOV R7,#248 </P>
<P class=style25>DJNZ R7,$ </P>
<P class=style25>DJNZ R6,D1 </P>
<P class=style25>DJNZ R5,D2 </P>
<P class=style25>RET </P>
<P class=style25>TABLE: DB 3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FH </P>
<P class=style25>END </P>
<P class=style25><STRONG>7. C语言源程序 </STRONG></P>
<P class=style25>#include <AT89X51.H> </P>
<P class=style25>unsigned char code table[]={0x3f,0x06,0x5b,0x4f,0x66, </P>
<P class=style25>0x6d,0x7d,0x07,0x7f,0x6f}; </P>
<P class=style25>unsigned char dispcount; </P>
<P class=style25>void delay02s(void) </P>
<P class=style25>{ </P>
<P class=style25>unsigned char i,j,k; </P>
<P class=style25>for(i=20;i>0;i--) </P>
<P class=style25>for(j=20;j>0;j--) </P>
<P class=style25>for(k=248;k>0;k--); </P>
<P class=style25>} </P>
<P class=style25>void main(void) </P>
<P class=style25>{ </P>
<P class=style25>while(1) </P>
<P class=style25>{ </P>
<P class=style25>for(dispcount=0;dispcount<10;dispcount++) </P>
<P class=style25>{ </P>
<P class=style25>P0=table[dispcount]; </P>
<P class=style25>delay02s(); </P>
<P class=style25>} </P>
<P class=style25>} </P>
<P class=style25>} </P>
<P class=style25 align=left> </P></TD></TR></TBODY></TABLE></SPAN></TD></TR></TBODY></TABLE><BR>
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
<TBODY>
<TR>
<TD width="46%"><SPAN class=style4><a href=more.asp?name=gooker&id=5032>阅读全文(107)</a> | <a href=more.asp?name=gooker&id=5032#comment>回复(0)</a> | <a href=showtb.asp?id=5032 target=_blank>引用(0)</a></SPAN></TD>
<TD width="54%">
<DIV align=right><SPAN class=style6>gooker 发表于 2005-11-3 18:27:00</SPAN> </DIV></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><BR>只有登陆后才能发表留言!请<a href=default.asp target=_blank>返回登陆</a>
<BR></FONT></TD></TR>
<TR>
<TD style="BORDER-RIGHT: black 1px solid; BORDER-LEFT: black 1px solid" vAlign=top align=middle colSpan=2 height=0></TD>
<TR>
<TD style="BORDER-RIGHT: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid" vAlign=top align=middle colSpan=2></TD></TR></TBODY></TABLE><BR><BR></DIV>
<SCRIPT language="javascript">
function del_space(s)
{
for(i=0;i<s.length;++i)
{
if(s.charAt(i)!=" ")
break;
}
for(j=s.length-1;j>=0;--j)
{
if(s.charAt(j)!=" ")
break;
}
return s.substring(i,++j);
}
function Verifycomment()
{
//submits();
v = del_space(document.commentform.commenttopic.value);
if (v.length == 0)
{
alert("您忘了填写题目!");
return false;
}
v = del_space(document.commentform.UserName.value);
if (v.length == 0)
{
alert("您忘了留下名字!");
return false;
}
submits();
if (document.commentform.edit.value == "")
{
alert("内容不能为空!");
return false;
}
return true;
}
</SCRIPT>
<div align=center><center><table border=0 bgcolor=#ffffff><tr><td><center><br>本工程师笔记系统由<a href=http://www.21ic.com target=_blank>21IC中国电子网提供服务器支持.<script src=http://www.99count.com/count.asp?user=21ic></a></script></center></td></tr></table></center></div>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -