<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta name="generator" content="pdf2htmlEX">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" href="https://static.pudn.com/base/css/base.min.css">
<link rel="stylesheet" href="https://static.pudn.com/base/css/fancy.min.css">
<link rel="stylesheet" href="https://static.pudn.com/prod/directory_preview_static/626938620990925c0443d2fa/raw.css">
<script src="https://static.pudn.com/base/js/compatibility.min.js"></script>
<script src="https://static.pudn.com/base/js/pdf2htmlEX.min.js"></script>
<script>
try{
pdf2htmlEX.defaultViewer = new pdf2htmlEX.Viewer({});
}catch(e){}
</script>
<title></title>
</head>
<body>
<div id="sidebar" style="display: none">
<div id="outline">
</div>
</div>
<div id="pf1" class="pf w0 h0" data-page-no="1"><div class="pc pc1 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/626938620990925c0443d2fa/bg1.jpg"><div class="c x0 y1 w2 h2"><div class="t m0 x1 h3 y2 ff1 fs0 fc0 sc0 ls0 ws0">矩阵键盘和动态数码管的操作</div><div class="t m0 x2 h4 y3 ff2 fs1 fc0 sc1 ls0 ws0">/**** <span class="ff1">头文件,宏定义,写程序前先复制进来在说</span> *******/</div><div class="t m0 x2 h5 y4 ff2 fs1 fc0 sc1 ls0 ws0">#include<REG52.H> </div><div class="t m0 x2 h5 y5 ff2 fs1 fc0 sc1 ls0 ws0">#include<intrins.h></div><div class="t m0 x2 h5 y6 ff2 fs1 fc0 sc1 ls0 ws0">#define uchar unsigned char </div><div class="t m0 x2 h5 y7 ff2 fs1 fc0 sc1 ls0 ws0">#define uint unsigned int </div><div class="t m0 x2 h4 y8 ff2 fs1 fc0 sc1 ls0 ws0">/*<span class="ff1">位定义</span> <span class="ff1">当要用到位操作时就要用到</span>*/</div><div class="t m0 x2 h5 y9 ff2 fs1 fc0 sc1 ls0 ws0">sbit P24=P2^4;sbit P25=P2^5;sbit P26=P2^6;sbit P27=P2^7;</div><div class="t m0 x2 h4 ya ff2 fs1 fc0 sc1 ls0 ws0">/*<span class="ff1">延时函数,延时<span class="_ _0"> </span></span>1<span class="_ _0"> </span><span class="ff1">毫秒</span>*/</div><div class="t m0 x2 h5 yb ff2 fs1 fc0 sc1 ls0 ws0">void delay(uint a) </div><div class="t m0 x2 h5 yc ff2 fs1 fc0 sc1 ls0 ws0">{</div><div class="t m0 x3 h5 yd ff2 fs1 fc0 sc1 ls0 ws0">unsigned char j;</div><div class="t m0 x3 h5 ye ff2 fs1 fc0 sc1 ls0 ws0">for(;a>0;a--)</div><div class="t m0 x3 h4 yf ff2 fs1 fc0 sc1 ls0 ws0">for(j=1<span class="_ _1"></span>10;j>0;j--);//<span class="ff1">注意这里的分号它代表一个空语句</span></div><div class="t m0 x2 h5 y10 ff2 fs1 fc0 sc1 ls0 ws0">}<span class="_ _2"> </span> </div><div class="t m0 x2 h4 y11 ff2 fs1 fc0 sc1 ls0 ws0">/***<span class="ff1">函数功能:判断是否有按键按下,有的话则返回<span class="_ _0"> </span></span>1<span class="ff1">,否则返回<span class="_ _0"> </span></span>0***/</div><div class="t m0 x2 h5 y12 ff2 fs1 fc0 sc1 ls0 ws0">uchar keypress()</div><div class="t m0 x2 h5 y13 ff2 fs1 fc0 sc1 ls0 ws0">{</div></div></div><div class="pi" data-data='{"ctm":[1.611850,0.000000,0.000000,1.611850,0.000000,0.000000]}'></div></div>
</body>
</html>