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

📄 max7219驱动8个数码管代码及电路图 -- jiereliyi's blog.htm

📁 有关max7219的资料
💻 HTM
📖 第 1 页 / 共 3 页
字号:
}
A.red:hover {
	COLOR: #ee9700; TEXT-DECORATION: none
}
.simpleblank {
	DISPLAY: none
}
.simpleimg {
	DISPLAY: block
}
</STYLE>

<SCRIPT type=text/javascript>
    function notifyreply() {
        alert("请先登录然后下载");
    }
</SCRIPT>

<DIV class=DiaryArticle id=ListDiary>
<DIV id=Article>
<DIV class=Main>
<DIV class=Title>
<H2>日志档案</H2></DIV>
<DIV class="DiaryMain MarginBottom10">
<DIV class=PublishTime>发表于 2008/9/10 17:53:15</DIV>
<DIV class=Content>
<DIV class=Ballot>
<DIV class=digg id=ctl00_ctl00_SkinBody_Content_ContentControl_ctl00_Digg2>
<H4 id=ctl00_ctl00_SkinBody_Content_ContentControl_ctl00_Digg2_display 
style="opacity: 1">2 </H4><SPAN class=unclicked onmouseover=Digg_Mouseover(this) 
onclick="if(this.className != 'clicked'){WebForm_DoCallback('ctl00$ctl00$SkinBody$Content$ContentControl$ctl00$Digg2',null,DiggClientCallBack,null,null,true)}" 
onmouseout=Digg_Mouseout(this)></SPAN></DIV>
<DIV class=simpleblank><A title=察看所有博客精华文章 
href="http://blog.ednchina.com/cool.aspx"><IMG 
id=ctl00_ctl00_SkinBody_Content_ContentControl_ctl00_imgEssent 
style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" 
src=""> </A></DIV></DIV>
<DIV class=Text>
<P class=Label>标签: <A title=max7219 
href="http://blog.ednchina.com/Label/max7219.aspx">max7219</A>&nbsp;&nbsp;<A 
title=代码 
href="http://blog.ednchina.com/Label/代ç&nbsp;.aspx">代码</A>&nbsp;&nbsp;</P>
<H1><A 
href="http://blog.ednchina.com/jiereliyi/159337/Message.aspx#">max7219驱动8个数码管代码及电路图</A></H1>
<P>
<P><A 
href="max7219驱动8个数码管代码及电路图 -- jiereliyi's Blog.files/c1217e55-a973-4bbd-afa1-bee00e909dc0.jpg" 
target=_blank><IMG height=227 alt=点击看大图 
src="max7219驱动8个数码管代码及电路图 -- jiereliyi's Blog.files/c1217e55-a973-4bbd-afa1-bee00e909dc0.jpg" 
width=520></A></P>
<P>#include "reg52.h"<BR>#include "my_type.h"</P>
<P>#define Addr_No_Op&nbsp; &nbsp;&nbsp;0x00&nbsp; &nbsp;//不工作寄存器地址<BR>#define 
Addr_Digit0&nbsp;&nbsp;&nbsp;0x01<BR>#define Addr_Digit1 
&nbsp;&nbsp;0x02<BR>#define Addr_Digit2 &nbsp;&nbsp;0x03<BR>#define Addr_Digit3 
&nbsp;&nbsp;0x04<BR>#define Addr_Digit4 &nbsp;&nbsp;0x05<BR>#define Addr_Digit5 
&nbsp;&nbsp;0x06 <BR>#define Addr_Digit6 &nbsp;&nbsp;0x07<BR>#define Addr_Digit7 
&nbsp;&nbsp;0x08<BR>#define Addr_Decode_Mode&nbsp;0x09&nbsp;&nbsp;&nbsp; 
//译码模式寄存器地址<BR>#define Addr_Intensity&nbsp;&nbsp; 
&nbsp;0x0a&nbsp;//亮度控制寄存器地址(max7221)<BR>#define Addr_Scan_Limit&nbsp; 
&nbsp;0x0b&nbsp;//扫描控制寄存器地址<BR>#define Addr_Shutdowm&nbsp;&nbsp;&nbsp; 
&nbsp;0x0c&nbsp;&nbsp;&nbsp; //掉电模式寄存器地址<BR>#define Addr_Display_Test 
&nbsp;0x0f&nbsp;&nbsp;&nbsp; //显示检测寄存器地址</P>
<P>sbit Max7219_Din=P1^5;<BR>sbit Max7219_Load=P1^6;<BR>sbit 
Max7219_Clk=P1^7;</P>
<P>uchar code max7219_7led_code[18]={0x7e,0x30,0x6d,0x79,&nbsp; 
//0-1-2-3<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
0x33,0x5b,0x5f,0x70,&nbsp; 
//4-5-6-7<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
0x7f,0x7b,0x01,0x4e,&nbsp; 
//8-9-"-"-E<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
0x37,0x0e,0x67,0x00};&nbsp; //H-L-P-空白&nbsp;&nbsp;&nbsp;&nbsp; </P>
<P><BR>void wr_max7219(uchar addr,uchar dat)<BR>{<BR>&nbsp;uchar 
i;<BR>&nbsp;Max7219_Load=0;<BR>&nbsp;Max7219_Clk=0;<BR>&nbsp;for(i=0;i&lt;8;i++)<BR>&nbsp;{<BR>&nbsp;&nbsp;Max7219_Din 
= 
(bit)(addr&amp;0x80);<BR>&nbsp;&nbsp;addr=addr&lt;&lt;1;<BR>&nbsp;&nbsp;Max7219_Clk=1;<BR>&nbsp;&nbsp;Max7219_Clk=0;<BR>&nbsp;}<BR>&nbsp;for(i=0;i&lt;8;i++)<BR>&nbsp;{&nbsp;<BR>&nbsp;&nbsp;Max7219_Din=(bit)(dat&amp;0x80);<BR>&nbsp;&nbsp;dat=dat&lt;&lt;1;<BR>&nbsp;&nbsp;Max7219_Clk=1;<BR>&nbsp;&nbsp;Max7219_Clk=0;<BR>&nbsp;}&nbsp;&nbsp;<BR>&nbsp;Max7219_Load=1;<BR>&nbsp;Max7219_Load=0;<BR>}<BR>main()<BR>{<BR>&nbsp; 
&nbsp;uchar j;<BR>&nbsp;for(j=200;j&gt;0;j--);<BR>&nbsp; &nbsp; 
<BR>&nbsp;wr_max7219(Addr_Shutdowm,0x01);<BR>&nbsp;wr_max7219(Addr_Scan_Limit,0x07);<BR>&nbsp;wr_max7219(Addr_Intensity,0x0f);<BR>&nbsp;wr_max7219(Addr_Decode_Mode,0x00);<BR>&nbsp;wr_max7219(Addr_Digit0,max7219_7led_code[1]);<BR>&nbsp;wr_max7219(Addr_Digit1,max7219_7led_code[2]);<BR>&nbsp;wr_max7219(Addr_Digit2,max7219_7led_code[3]);<BR>&nbsp;wr_max7219(Addr_Digit3,max7219_7led_code[4]);<BR>&nbsp;wr_max7219(Addr_Digit4,max7219_7led_code[5]);<BR>&nbsp;wr_max7219(Addr_Digit5,max7219_7led_code[6]);<BR>&nbsp;wr_max7219(Addr_Digit6,max7219_7led_code[7]);<BR>&nbsp;&nbsp;&nbsp; 
wr_max7219(Addr_Digit7,max7219_7led_code[8]);</P>
<P>&nbsp; &nbsp; P0=0x00;<BR>&nbsp;//&nbsp; 
wr_max7219(Addr_Display_Test,0x01);&nbsp;&nbsp; //测试<BR>&nbsp;&nbsp; 
while(1);<BR>}</P>
<P></P>
<P class=TextInfo>系统分类: <A 
href="http://blog.ednchina.com/10042/Category.aspx">单片机</A>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;用户分类: 
<A 
href="http://blog.ednchina.com/jiereliyi/19846/category.aspx">单片机</A>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;来源: 
原创&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<A id=aRecommend 
href="http://article.ednchina.com/tools/mail.aspx?type=blog&amp;id=159337">【推荐给朋友】</A>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<A 
id=ctl00_ctl00_SkinBody_Content_ContentControl_ctl00_lbAddFavourite 
href="javascript:__doPostBack('ctl00$ctl00$SkinBody$Content$ContentControl$ctl00$lbAddFavourite','')">【添加到收藏夹】</A> 
</P></DIV>
<DIV class=clear></DIV></DIV>
<DIV 
class=DiaryInfo>&nbsp;&nbsp;&nbsp;&nbsp;阅读(945)&nbsp;&nbsp;&nbsp;&nbsp;回复(0)&nbsp;&nbsp; 
</DIV></DIV><!--投票-->
<DIV style="DISPLAY: none; PADDING-BOTTOM: 10px">
<P><A href="http://blog.ednchina.com/jiereliyi/159337/"><IMG 
src="max7219驱动8个数码管代码及电路图 -- jiereliyi's Blog.files/vote.gif" 
align=absMiddle></A><SPAN 
style="PADDING-LEFT: 15px">投一票您将和博主都有获奖机会!</SPAN></P></DIV>
<DIV id=Comment>
<DIV id=CommentTitle>
<H2 style="FLOAT: left">最新评论 </H2></DIV>
<DIV class=Content>
<UL></UL></DIV>
<DIV class=FillIn><A name=feedback>
<TABLE id=simplyreply style="MARGIN-LEFT: 30px">
  <TBODY>
  <TR>
    <TD><SPAN style="MARGIN-RIGHT: 30px">标题</SPAN> <SPAN><INPUT 
      id=ctl00_ctl00_SkinBody_Content_SimplyReplyControl_SubjectControl 
      style="WIDTH: 350px" value=re:max7219驱动8个数码管代码及电路图 
      name=ctl00$ctl00$SkinBody$Content$SimplyReplyControl$SubjectControl></SPAN> 
    </TD></TR>
  <TR>
    <TD><SPAN style="MARGIN-RIGHT: 30px">姓名</SPAN> <SPAN><INPUT 
      id=ctl00_ctl00_SkinBody_Content_SimplyReplyControl_UserNameControl 
      style="WIDTH: 350px" 
      name=ctl00$ctl00$SkinBody$Content$SimplyReplyControl$UserNameControl></SPAN> 
      <SPAN 
      id=ctl00_ctl00_SkinBody_Content_SimplyReplyControl_RequiredFieldValidator2 
      style="VISIBILITY: hidden; COLOR: red">必填</SPAN> </TD></TR>
  <TR>
    <TD><SPAN style="MARGIN-RIGHT: 30px">主页</SPAN> <SPAN><INPUT 
      id=ctl00_ctl00_SkinBody_Content_SimplyReplyControl_HomePageControl 
      style="WIDTH: 350px" 
      name=ctl00$ctl00$SkinBody$Content$SimplyReplyControl$HomePageControl></SPAN> 
    </TD></TR>
  <TR>
    <TD style="PADDING-LEFT: 64px"><TEXTAREA id=ctl00_ctl00_SkinBody_Content_SimplyReplyControl_ContentControl style="WIDTH: 350px; HEIGHT: 200px" name=ctl00$ctl00$SkinBody$Content$SimplyReplyControl$ContentControl></TEXTAREA> 
    </TD></TR>
  <TR>
    <TD><SPAN style="MARGIN-LEFT: 11px">验证码:</SPAN><INPUT 
      id=ctl00_ctl00_SkinBody_Content_SimplyReplyControl_EnterCodeControl 
      style="WIDTH: 50px" maxLength=4 
      name=ctl00$ctl00$SkinBody$Content$SimplyReplyControl$EnterCodeControl> 
      <IMG id=ctl00_ctl00_SkinBody_Content_SimplyReplyControl_DisplayCodeControl 
      style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" 
      src="max7219驱动8个数码管代码及电路图 -- jiereliyi's Blog.files/ValidateCode.gif"> 
      <SPAN 
      id=ctl00_ctl00_SkinBody_Content_SimplyReplyControl_ValidateCodeControl 
      style="VISIBILITY: hidden; COLOR: red">验证码不正确</SPAN> </TD></TR>
  <TR>
    <TD><INPUT id=ctl00_ctl00_SkinBody_Content_SimplyReplyControl_Button1 onclick='javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ctl00$SkinBody$Content$SimplyReplyControl$Button1", "", true, "Post", "", false, false))' type=submit value=" 提 交 " name=ctl00$ctl00$SkinBody$Content$SimplyReplyControl$Button1> 
    </TD></TR></TBODY></TABLE></A></DIV></DIV></DIV></DIV></DIV>
<SCRIPT src="max7219驱动8个数码管代码及电路图 -- jiereliyi's Blog.files/Relation.htm" 
type=text/javascript></SCRIPT>

<DIV style="CLEAR: both"></DIV></DIV><!--结束--></DIV>
<SCRIPT type=text/javascript>
//<![CDATA[
var Page_Validators =  new Array(document.getElementById("ctl00_ctl00_SkinBody_Content_SimplyReplyControl_RequiredFieldValidator2"), document.getElementById("ctl00_ctl00_SkinBody_Content_SimplyReplyControl_ValidateCodeControl"));
//]]>
</SCRIPT>

<SCRIPT type=text/javascript>
//<![CDATA[
var ctl00_ctl00_SkinBody_Content_SimplyReplyControl_RequiredFieldValidator2 = document.all ? document.all["ctl00_ctl00_SkinBody_Content_SimplyReplyControl_RequiredFieldValidator2"] : document.getElementById("ctl00_ctl00_SkinBody_Content_SimplyReplyControl_RequiredFieldValidator2");
ctl00_ctl00_SkinBody_Content_SimplyReplyControl_RequiredFieldValidator2.controltovalidate = "ctl00_ctl00_SkinBody_Content_SimplyReplyControl_UserNameControl";
ctl00_ctl00_SkinBody_Content_SimplyReplyControl_RequiredFieldValidator2.errormessage = "必填";
ctl00_ctl00_SkinBody_Content_SimplyReplyControl_RequiredFieldValidator2.validationGroup = "Post";
ctl00_ctl00_SkinBody_Content_SimplyReplyControl_RequiredFieldValidator2.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
ctl00_ctl00_SkinBody_Content_SimplyReplyControl_RequiredFieldValidator2.initialvalue = "";
var ctl00_ctl00_SkinBody_Content_SimplyReplyControl_ValidateCodeControl = document.all ? document.all["ctl00_ctl00_SkinBody_Content_SimplyReplyControl_ValidateCodeControl"] : document.getElementById("ctl00_ctl00_SkinBody_Content_SimplyReplyControl_ValidateCodeControl");
ctl00_ctl00_SkinBody_Content_SimplyReplyControl_ValidateCodeControl.controltovalidate = "ctl00_ctl00_SkinBody_Content_SimplyReplyControl_EnterCodeControl";
ctl00_ctl00_SkinBody_Content_SimplyReplyControl_ValidateCodeControl.validationGroup = "Post";
//]]>
</SCRIPT>

<SCRIPT type=text/javascript>
//<![CDATA[

var Page_ValidationActive = false;
if (typeof(ValidatorOnLoad) == "function") {
    ValidatorOnLoad();
}

function ValidatorOnSubmit() {
    if (Page_ValidationActive) {
        return ValidatorCommonOnSubmit();
    }
    else {
        return true;
    }
}
        
theForm.oldSubmit = theForm.submit;
theForm.submit = WebForm_SaveScrollPositionSubmit;

theForm.oldOnSubmit = theForm.onsubmit;
theForm.onsubmit = WebForm_SaveScrollPositionOnSubmit;

WebForm_InitCallback();//]]>
</SCRIPT>
</FORM><!-- 统计必备 -->
<SCRIPT type=text/javascript>
var referrer = document.referrer;  
var url = "<scr"+"ipt type=\"text/javascript\" src=\"http://www.ednchina.com/Statistics.aspx?list="+escape(ad_list)+"&referer="+referrer+"\"></script\>";
document.write(url);

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
try {
    var pageTracker = _gat._getTracker("UA-115730-2");
    pageTracker._trackPageview();
} catch (err) { }

</SCRIPT>
<!-- 统计必备 --></BODY></HTML>

⌨️ 快捷键说明

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