<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/62799031517cd20ea4d6236e/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/62799031517cd20ea4d6236e/bg1.jpg"><div class="t m0 x1 h2 y1 ff1 fs0 fc0 sc0 ls0 ws0"> </div><div class="t m0 x1 h2 y2 ff1 fs0 fc0 sc0 ls0 ws0"> </div><div class="t m0 x2 h3 y3 ff2 fs1 fc0 sc1 ls0 ws0">本书简介</div><div class="t m0 x2 h3 y4 ff2 fs1 fc0 sc1 ls0 ws0"> </div><div class="t m0 x2 h4 y5 ff2 fs0 fc1 sc0 ls0 ws0">本书基于Keil μVision程序设计平台和Proteus硬件仿真平台,精心编写了100余个8051单片机C语言程</div><div class="t m0 x2 h4 y6 ff2 fs0 fc1 sc0 ls0 ws0">序设计案例。</div><div class="t m0 x2 h4 y7 ff2 fs0 fc1 sc0 ls0 ws0"> 全书基础设计类案例贯穿8051单片机最基本的端口编程、定时/计数器应用、中断和串口通信;硬</div><div class="t m0 x2 h4 y8 ff2 fs0 fc1 sc0 ls0 ws0">件应用类案例涵盖常用外部存储器扩展、接口扩展、译码、编码、驱动、光机、机电、A/D与</div><div class="t m0 x2 h4 y9 ff2 fs0 fc1 sc0 ls0 ws0">D/A转换等内容;综合设计类案例涉及大量消费类电子产品、仪器仪表及智能控制设备的相关技术</div><div class="t m0 x2 h4 ya ff2 fs0 fc1 sc0 ls0 ws0">。</div><div class="t m0 x2 h4 yb ff2 fs0 fc1 sc0 ls0 ws0"> 本书可作为大专院校学生学习实践单片机c语言程序设计的教材或参考书,也可作为电子工程技术</div><div class="t m0 x2 h4 yc ff2 fs0 fc1 sc0 ls0 ws0">人员或单片机技术爱好者的参考资料。</div><div class="t m0 x2 h4 yd ff2 fs0 fc1 sc0 ls0 ws0"> </div><div class="t m0 x2 h3 ye ff2 fs0 fc1 sc0 ls0 ws0"> <span class="fs1 fc0 sc1">目录</span></div><div class="t m0 x2 h3 yf ff2 fs1 fc0 sc1 ls0 ws0"> </div><div class="t m0 x2 h4 y10 ff2 fs0 fc1 sc0 ls0 ws0">第1章 8051单片机C语言程序设计概述</div></div><div class="pi" data-data='{"ctm":[1.611639,0.000000,0.000000,1.611639,0.000000,0.000000]}'></div></div>
</body>
</html>
<div id="pf2" class="pf w0 h0" data-page-no="2"><div class="pc pc2 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/62799031517cd20ea4d6236e/bg2.jpg"><div class="t m0 x2 h4 y11 ff2 fs0 fc1 sc0 ls0 ws0"> 1.1 8051单片机引脚</div><div class="t m0 x2 h4 y12 ff2 fs0 fc1 sc0 ls0 ws0"> 1.2 数据与程序内存</div><div class="t m0 x2 h4 y13 ff2 fs0 fc1 sc0 ls0 ws0"> 1.3 特殊功能寄存器</div><div class="t m0 x2 h4 y14 ff2 fs0 fc1 sc0 ls0 ws0"> 1.4 外部中断、定时/计数器及串口应用</div><div class="t m0 x2 h4 y15 ff2 fs0 fc1 sc0 ls0 ws0"> 1.5 有符号与无符号数应用、数位分解、位操作</div><div class="t m0 x2 h4 y16 ff2 fs0 fc1 sc0 ls0 ws0"> 1.6 变量、存储类型与存储模式</div><div class="t m0 x2 h4 y17 ff2 fs0 fc1 sc0 ls0 ws0"> 1.7 数组、字符串与指针</div><div class="t m0 x2 h4 y18 ff2 fs0 fc1 sc0 ls0 ws0"> 1.8 流程控制</div><div class="t m0 x2 h4 y19 ff2 fs0 fc1 sc0 ls0 ws0"> 1.9 可重入函数和中断函数</div><div class="t m0 x2 h4 y1a ff2 fs0 fc1 sc0 ls0 ws0"> 1.10 C语言在单片机系统开发中的优势</div><div class="t m0 x2 h4 y1b ff2 fs0 fc1 sc0 ls0 ws0">第2章 Proteus操作基础</div><div class="t m0 x2 h4 y1c ff2 fs0 fc1 sc0 ls0 ws0"> 2.1 Proteus操作界面简介</div><div class="t m0 x2 h4 y1d ff2 fs0 fc1 sc0 ls0 ws0"> 2.2 仿真电路原理图设计</div><div class="t m0 x2 h4 y1e ff2 fs0 fc1 sc0 ls0 ws0"> 2.3 元件选择</div><div class="t m0 x2 h4 y1f ff2 fs0 fc1 sc0 ls0 ws0"> 2.4 调试仿真</div><div class="t m0 x2 h4 y20 ff2 fs0 fc1 sc0 ls0 ws0"> 2.5 Proteus与&#61549; V3的联合调试</div><div class="t m0 x2 h4 y21 ff2 fs0 fc1 sc0 ls0 ws0">第3章 基础程序设计</div><div class="t m0 x2 h4 y22 ff2 fs0 fc1 sc0 ls0 ws0"> 3.1 闪烁的LED</div><div class="t m0 x2 h4 y23 ff2 fs0 fc1 sc0 ls0 ws0"> 3.2 从左到右的流水灯</div><div class="t m0 x2 h4 y24 ff2 fs0 fc1 sc0 ls0 ws0"> 3.3 左右来回循环的流水灯</div><div class="t m0 x2 h4 y25 ff2 fs0 fc1 sc0 ls0 ws0"> 3.4 花样流水灯</div><div class="t m0 x2 h4 y26 ff2 fs0 fc1 sc0 ls0 ws0"> 3.5 LED模拟交通灯</div><div class="t m0 x2 h4 y27 ff2 fs0 fc1 sc0 ls0 ws0"> 3.6 单只数码管循环显示0~9</div><div class="t m0 x2 h4 y28 ff2 fs0 fc1 sc0 ls0 ws0"> 3.7 8只数码管滚动显示单个数字</div><div class="t m0 x2 h4 y29 ff2 fs0 fc1 sc0 ls0 ws0"> 3.8 8只数码管显示多个不同字符</div><div class="t m0 x2 h4 y2a ff2 fs0 fc1 sc0 ls0 ws0"> 3.9 数码管闪烁显示</div><div class="t m0 x2 h4 y2b ff2 fs0 fc1 sc0 ls0 ws0"> 3.10 8只数码管滚动显示数字串</div><div class="t m0 x2 h4 y2c ff2 fs0 fc1 sc0 ls0 ws0"> 3.11 K1~K4控制LED移位</div><div class="t m0 x2 h4 y2d ff2 fs0 fc1 sc0 ls0 ws0"> 3.12 K1~K4按键状态显示</div><div class="t m0 x2 h4 y2e ff2 fs0 fc1 sc0 ls0 ws0"> 3.13 K1~K4分组控制LED</div><div class="t m0 x2 h4 y2f ff2 fs0 fc1 sc0 ls0 ws0"> 3.14 K1~K4控制数码管移位显示</div><div class="t m0 x2 h4 y30 ff2 fs0 fc1 sc0 ls0 ws0"> 3.15 K1~K4控制数码管加减演示</div><div class="t m0 x2 h4 y31 ff2 fs0 fc1 sc0 ls0 ws0"> 3.16 4×4键盘矩阵控制条形LED显示</div><div class="t m0 x2 h4 y32 ff2 fs0 fc1 sc0 ls0 ws0"> 3.17 数码管显示4×4键盘矩阵按键</div><div class="t m0 x2 h4 y33 ff2 fs0 fc1 sc0 ls0 ws0"> 3.18 开关控制LED</div><div class="t m0 x2 h4 y34 ff2 fs0 fc1 sc0 ls0 ws0"> 3.19 继电器控制照明设备</div><div class="t m0 x2 h4 y35 ff2 fs0 fc1 sc0 ls0 ws0"> 3.20 数码管显示拨码开关编码</div><div class="t m0 x2 h4 y36 ff2 fs0 fc1 sc0 ls0 ws0"> 3.21 开关控制报警器</div><div class="t m0 x2 h4 y37 ff2 fs0 fc1 sc0 ls0 ws0"> 3.22 按键发音</div><div class="t m0 x2 h4 y38 ff2 fs0 fc1 sc0 ls0 ws0"> 3.23 播放音乐</div><div class="t m0 x2 h4 y39 ff2 fs0 fc1 sc0 ls0 ws0"> 3.24 INT0中断计数</div><div class="t m0 x2 h4 y3a ff2 fs0 fc1 sc0 ls0 ws0"> 3.25 INT0中断控制LED</div><div class="t m0 x2 h4 y3b ff2 fs0 fc1 sc0 ls0 ws0"> 3.26 INT0及INT1中断计数</div><div class="t m0 x2 h4 y3c ff2 fs0 fc1 sc0 ls0 ws0"> 3.27 TIMER0控制单只LED闪烁</div><div class="t m0 x2 h4 y3d ff2 fs0 fc1 sc0 ls0 ws0"> 3.28 TIMER0控制流水灯</div><div class="t m0 x2 h4 y3e ff2 fs0 fc1 sc0 ls0 ws0"> 3.29 TIMER0控制4只LED滚动闪烁</div><div class="t m0 x2 h4 y3f ff2 fs0 fc1 sc0 ls0 ws0"> 3.30 T0控制LED实现二进制计数</div><div class="t m0 x2 h4 y40 ff2 fs0 fc1 sc0 ls0 ws0"> 3.31 TIMER0与TIMER1控制条形LED</div></div><div class="pi" data-data='{"ctm":[1.611639,0.000000,0.000000,1.611639,0.000000,0.000000]}'></div></div>
<div id="pf3" class="pf w0 h0" data-page-no="3"><div class="pc pc3 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/62799031517cd20ea4d6236e/bg3.jpg"><div class="t m0 x2 h4 y11 ff2 fs0 fc1 sc0 ls0 ws0"> 3.32 10s的秒表</div><div class="t m0 x2 h4 y12 ff2 fs0 fc1 sc0 ls0 ws0"> 3.33 用计数器中断实现100以内的按键计数</div><div class="t m0 x2 h4 y13 ff2 fs0 fc1 sc0 ls0 ws0"> 3.34 10 000s以内的计时程序</div><div class="t m0 x2 h4 y14 ff2 fs0 fc1 sc0 ls0 ws0"> 3.35 定时器控制数码管动态显示</div><div class="t m0 x2 h4 y15 ff2 fs0 fc1 sc0 ls0 ws0"> 3.36 8×8 LED点阵屏显示数字</div><div class="t m0 x2 h4 y16 ff2 fs0 fc1 sc0 ls0 ws0"> 3.37 按键控制8×8 LED点阵屏显示图形</div><div class="t m0 x2 h4 y17 ff2 fs0 fc1 sc0 ls0 ws0"> 3.38 用定时器设计的门铃</div><div class="t m0 x2 h4 y18 ff2 fs0 fc1 sc0 ls0 ws0"> 3.39 演奏音阶</div><div class="t m0 x2 h4 y19 ff2 fs0 fc1 sc0 ls0 ws0"> 3.40 按键控制定时器选播多段音乐</div><div class="t m0 x2 h4 y1a ff2 fs0 fc1 sc0 ls0 ws0"> 3.41 定时器控制交通指示灯</div><div class="t m0 x2 h4 y1b ff2 fs0 fc1 sc0 ls0 ws0"> 3.42 报警器与旋转灯</div><div class="t m0 x2 h4 y1c ff2 fs0 fc1 sc0 ls0 ws0"> 3.43 串行数据转换为并行数据</div><div class="t m0 x2 h4 y1d ff2 fs0 fc1 sc0 ls0 ws0"> 3.44 并行数据转换为串行数据</div><div class="t m0 x2 h4 y1e ff2 fs0 fc1 sc0 ls0 ws0"> 3.45 甲机通过串口控制乙机LED闪烁</div><div class="t m0 x2 h4 y1f ff2 fs0 fc1 sc0 ls0 ws0"> 3.46 单片机之间双向通信</div><div class="t m0 x2 h4 y20 ff2 fs0 fc1 sc0 ls0 ws0"> 3.47 单片机向主机发送字符串</div><div class="t m0 x2 h4 y21 ff2 fs0 fc1 sc0 ls0 ws0"> 3.48 单片机与PC串口通信仿真</div><div class="t m0 x2 h4 y22 ff2 fs0 fc1 sc0 ls0 ws0">第4章 硬件应用</div><div class="t m0 x2 h4 y23 ff2 fs0 fc1 sc0 ls0 ws0"> 4.1 74LS138译码器应用</div><div class="t m0 x2 h4 y24 ff2 fs0 fc1 sc0 ls0 ws0"> 4.2 74HC154译码器应用</div><div class="t m0 x2 h4 y25 ff2 fs0 fc1 sc0 ls0 ws0"> 4.3 74HC595串入并出芯片应用</div><div class="t m0 x2 h4 y26 ff2 fs0 fc1 sc0 ls0 ws0"> 4.4 用74LS148扩展中断</div><div class="t m0 x2 h4 y27 ff2 fs0 fc1 sc0 ls0 ws0"> 4.5 I2C-24C04与蜂鸣器</div><div class="t m0 x2 h4 y28 ff2 fs0 fc1 sc0 ls0 ws0"> 4.6 I2C-24C04与数码管</div><div class="t m0 x2 h4 y29 ff2 fs0 fc1 sc0 ls0 ws0"> 4.7 用6264扩展内存</div><div class="t m0 x2 h4 y2a ff2 fs0 fc1 sc0 ls0 ws0"> 4.8 用8255实现接口扩展</div><div class="t m0 x2 h4 y2b ff2 fs0 fc1 sc0 ls0 ws0"> ……</div><div class="t m0 x2 h4 y2c ff2 fs0 fc1 sc0 ls0 ws0">第5章 综合设计</div><div class="t m0 x2 h4 y2d ff2 fs0 fc1 sc0 ls0 ws0">参考文献</div><div class="t m0 x2 h4 y2e ff2 fs0 fc1 sc0 ls0 ws0"> </div><div class="t m0 x2 h4 y2f ff2 fs0 fc1 sc0 ls0 ws0"> </div><div class="t m0 x1 h2 y30 ff1 fs0 fc0 sc0 ls0 ws0"> </div><div class="t m0 x3 h5 y31 ff2 fs2 fc2 sc2 ls0 ws0">下载后 点击此处查看更多内容<span class="ff1 fs0 fc0 sc0"> </span></div><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a></div><div class="pi" data-data='{"ctm":[1.611639,0.000000,0.000000,1.611639,0.000000,0.000000]}'></div></div>
<div id="pf4" class="pf w2 h0" data-page-no="4"><div class="pc pc4 w2 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/62799031517cd20ea4d6236e/bg4.jpg"><div class="t m0 x4 h6 y41 ff3 fs3 fc0 sc0 ls0 ws0">《单片机<span class="_ _0"> </span>语言程序设计实训<span class="_ _1"> </span>例<span class="_"> </span><span class="ls1">基于<span class="_ _2"> </span></span>和<span class="_ _3"> </span>仿真》案例<span class="_ _4"></span><span class="ff4">C<span class="_ _5"> </span>100<span class="_ _6"> </span><span class="ls2">---<span class="_ _7"> </span></span>8051<span class="_ _8"> </span><span class="ls3">PROTEUS<span class="_ _9"> </span></span> </span></div><div class="t m0 x5 h6 y42 ff4 fs3 fc0 sc0 ls0 ws0">1 </div><div class="t m0 x6 h6 y43 ff3 fs3 fc0 sc0 ls0 ws0">上海师范大学信息与机电工程学院—倪继锋<span class="ff4"> </span></div><div class="t m0 x7 h7 y44 ff3 fs0 fc0 sc1 ls4 ws0">《单片机<span class="ff5 sc0 ls0">C</span><span class="ls5">语言程序设计实训<span class="_ _a"> </span><span class="ff5 sc0 ls0">100<span class="_"> </span></span></span>例—基于<span class="_ _a"> </span><span class="ff5 sc0 ls6">8051+Proteus</span><span class="ls7">仿真》案例<span class="ff5 sc0 ls0"> </span></span></div><div class="t m0 x8 h7 y45 ff3 fs0 fc0 sc1 ls0 ws0">第<span class="ff5 sc0 ws1"> 01 </span>篇<span class="ff5 sc0"> <span class="_"> </span></span><span class="ls8">基础程序设计</span><span class="ff5 sc0"> </span></div><div class="t m0 x6 h8 y46 ff5 fs4 fc0 sc0 ls9 ws0">01 <span class="_ _b"> </span><span class="ff3 sc1 lsa">闪烁的<span class="_ _c"> </span></span><span class="lsb">LED </span></div><div class="t m0 x9 h8 y47 ff5 fs4 fc0 sc0 ls0 ws0"> </div><div class="t m0 x6 h9 y48 ff4 fs4 fc0 sc0 lsc ws2">/* <span class="_ _d"> </span><span class="ff3 ls0 ws0">名称:闪烁的<span class="_ _c"> </span><span class="ff4 lsd">LED </span></span></div><div class="t m0 x6 h9 y49 ff4 fs4 fc0 sc0 ls0 ws0"> <span class="_ _e"> </span><span class="ff3">说明:</span><span class="lse">LED<span class="_"> </span></span><span class="ff3">按设定的时间间隔闪烁</span> </div><div class="t m0 x6 h9 y4a ff4 fs4 fc0 sc0 lsc ws0">*/ </div><div class="t m0 x6 h9 y4b ff4 fs4 fc0 sc0 lsf ws0">#include<reg5<span class="_ _f"></span>1.h> </div><div class="t m0 x6 h9 y4c ff4 fs4 fc0 sc0 ls10 ws3">#define uchar unsigned char </div><div class="t m0 x6 h9 y4d ff4 fs4 fc0 sc0 lsf ws4">#define uint u<span class="_ _f"></span>nsigned int </div><div class="t m0 x6 h9 y4e ff4 fs4 fc0 sc0 ls10 ws3">sbit LED=P1^0; </div><div class="t m0 x6 h9 y4f ff4 fs4 fc0 sc0 ls11 ws0">//<span class="ff3 ls0">延时<span class="ff4"> </span></span></div><div class="t m0 x6 h9 y50 ff4 fs4 fc0 sc0 ls12 ws5">void DelayM<span class="_ _f"></span>S(uint x) </div><div class="t m0 x6 h9 y51 ff4 fs4 fc0 sc0 ls0 ws0">{ </div><div class="t m0 x6 h9 y52 ff4 fs4 fc0 sc0 ls13 ws6"> uchar <span class="_ _10"></span>i; </div><div class="t m0 x6 h9 y53 ff4 fs4 fc0 sc0 ls14 ws7"> while(x--) </div><div class="t m0 x6 h9 y54 ff4 fs4 fc0 sc0 ls0 ws8"> { </div><div class="t m0 x6 h9 y55 ff4 fs4 fc0 sc0 ls15 ws9"> for(i=0;i<120;i++); </div><div class="t m0 x6 h9 y56 ff4 fs4 fc0 sc0 ls0 ws8"> } </div><div class="t m0 x6 h9 y57 ff4 fs4 fc0 sc0 ls0 ws0">} </div><div class="t m0 x6 h9 y58 ff4 fs4 fc0 sc0 ls11 ws0">//<span class="ff3 ls0">主程序<span class="ff4"> </span></span></div><div class="t m0 x6 h9 y59 ff4 fs4 fc0 sc0 ls10 wsa">void main() </div><div class="t m0 x6 h9 y5a ff4 fs4 fc0 sc0 ls0 ws0">{ </div><div class="t m0 x6 h9 y5b ff4 fs4 fc0 sc0 lse wsb"> while(1) </div><div class="t m0 x6 h9 y5c ff4 fs4 fc0 sc0 ls0 ws8"> { </div><div class="t m0 x6 h9 y5d ff4 fs4 fc0 sc0 ls16 wsc"> LED=~LED; </div><div class="t m0 x6 h9 y5e ff4 fs4 fc0 sc0 ls17 wsd"> DelayMS(150); </div><div class="t m0 x6 h9 y5f ff4 fs4 fc0 sc0 ls0 ws8"> } </div><div class="t m0 x6 h9 y60 ff4 fs4 fc0 sc0 ls0 ws0">} </div><div class="t m0 x6 h9 y61 ff4 fs4 fc0 sc0 ls0 ws0"> </div><div class="t m0 x6 h8 y62 ff5 fs4 fc0 sc0 ls9 wse">02 <span class="ff3 sc1 lsa ws0">从左到右的流水灯</span><span class="ls0 ws0"> </span></div><div class="t m0 xa h9 y63 ff4 fs4 fc0 sc0 ls0 ws0"> </div><div class="t m0 x6 h9 y64 ff4 fs4 fc0 sc0 lsc ws2">/* <span class="_ _d"> </span><span class="ff3 ls0 ws0">名称:从左到右的流水灯<span class="ff4"> </span></span></div><div class="t m0 x6 h9 y65 ff4 fs4 fc0 sc0 ls0 ws0"> <span class="_ _e"> </span><span class="ff3">说明:<span class="_ _11"></span>接在<span class="_ _12"> </span><span class="ff4 ls18">P0<span class="_ _12"> </span></span>口的<span class="_ _12"> </span><span class="ff4">8<span class="_ _12"> </span></span>个<span class="_ _12"> </span><span class="ff4 ls19">LED</span></span></div><div class="t m0 x6 ha y66 ff3 fs4 fc0 sc0 ls0 ws0">从左到右循环依次点亮,<span class="_ _13"></span>产生走</div><div class="t m0 x6 h9 y67 ff3 fs4 fc0 sc0 ls0 ws0">马灯效果<span class="ff4"> </span></div><div class="t m0 x6 h9 y68 ff4 fs4 fc0 sc0 lsc ws0">*/ </div><div class="t m0 x6 h9 y69 ff4 fs4 fc0 sc0 lsf ws0">#include<reg5<span class="_ _f"></span>1.h> </div><div class="t m0 x6 h9 y6a ff4 fs4 fc0 sc0 lsf ws0">#include<intri<span class="_ _f"></span>ns.h> </div><div class="t m0 x6 h9 y6b ff4 fs4 fc0 sc0 ls10 ws3">#define uchar unsigned char </div><div class="t m0 x6 h9 y6c ff4 fs4 fc0 sc0 lsf ws4">#define uint u<span class="_ _f"></span>nsigned int </div><div class="c xb y6d w3 hb"><div class="t m0 x0 h4 y6e ff6 fs0 fc2 sc0 ls0 ws0">更多的资料尽在<span class="ff7">QQ</span>群</div></div><div class="c xc y6f w4 hb"><div class="t m0 x0 h2 y6e ff7 fs0 fc2 sc0 ls0 ws0">113831074</div></div><div class="c xd y70 w5 hc"><div class="t m0 x0 h4 y71 ff6 fs0 fc2 sc0 ls0 ws0">欢迎您的加入</div></div><div class="c xe y72 w6 hd"><div class="t m0 x0 h4 y73 ff6 fs0 fc2 sc0 ls0 ws0">注明电子爱好者,共同学习</div></div></div><div class="pi" data-data='{"ctm":[1.611639,0.000000,0.000000,1.611639,0.000000,0.000000]}'></div></div>
<div id="pf5" class="pf w2 h0" data-page-no="5"><div class="pc pc5 w2 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/62799031517cd20ea4d6236e/bg5.jpg"><div class="t m0 x4 h6 y41 ff3 fs3 fc0 sc0 ls0 ws0">《单片机<span class="_ _0"> </span>语言程序设计实训<span class="_ _1"> </span>例<span class="_"> </span><span class="ls1">基于<span class="_ _2"> </span></span>和<span class="_ _3"> </span>仿真》案例<span class="_ _4"></span><span class="ff4">C<span class="_ _5"> </span>100<span class="_ _6"> </span><span class="ls2">---<span class="_ _7"> </span></span>8051<span class="_ _8"> </span><span class="ls3">PROTEUS<span class="_ _9"> </span></span> </span></div><div class="t m0 x5 h6 y42 ff4 fs3 fc0 sc0 ls0 ws0">2 </div><div class="t m0 x6 h6 y43 ff3 fs3 fc0 sc0 ls0 ws0">上海师范大学信息与机电工程学院—倪继锋<span class="ff4"> </span></div><div class="t m0 x6 h9 y74 ff4 fs4 fc0 sc0 ls11 ws0">//<span class="ff3 ls0">延时<span class="ff4"> </span></span></div><div class="t m0 x6 h9 y75 ff4 fs4 fc0 sc0 ls12 ws5">void DelayM<span class="_ _f"></span>S(uint x) </div><div class="t m0 x6 h9 y76 ff4 fs4 fc0 sc0 ls0 ws0">{ </div><div class="t m0 x6 h9 y77 ff4 fs4 fc0 sc0 ls13 ws6"> uchar <span class="_ _10"></span>i; </div><div class="t m0 x6 h9 y78 ff4 fs4 fc0 sc0 ls14 ws7"> while(x--) </div><div class="t m0 x6 h9 y79 ff4 fs4 fc0 sc0 ls0 ws8"> { </div><div class="t m0 x6 h9 y7a ff4 fs4 fc0 sc0 ls15 ws9"> for(i=0;i<120;i++); </div><div class="t m0 x6 h9 y7b ff4 fs4 fc0 sc0 ls0 ws8"> } </div><div class="t m0 x6 h9 y7c ff4 fs4 fc0 sc0 ls0 ws0">} </div><div class="t m0 x6 h9 y7d ff4 fs4 fc0 sc0 ls11 ws0">//<span class="ff3 ls0">主程序<span class="ff4"> </span></span></div><div class="t m0 x6 h9 y7e ff4 fs4 fc0 sc0 ls10 wsa">void main() </div><div class="t m0 x6 h9 y7f ff4 fs4 fc0 sc0 ls0 ws0">{ </div><div class="t m0 x6 h9 y80 ff4 fs4 fc0 sc0 ls1a wsf"> P0=0xfe; </div><div class="t m0 x6 h9 y81 ff4 fs4 fc0 sc0 lse wsb"> while(1) </div><div class="t m0 x6 h9 y82 ff4 fs4 fc0 sc0 ls0 ws8"> { </div><div class="t m0 x6 h9 y83 ff4 fs4 fc0 sc0 ls15 ws9"> P0=_crol_(P0,1); <span class="_ _10"></span>//P0<span class="_ _c"> </span><span class="ff3 ls0 ws0">的值向左循环移动<span class="ff4"> </span></span></div><div class="t m0 x6 h9 y84 ff4 fs4 fc0 sc0 ls17 wsd"> DelayMS(150); </div><div class="t m0 x6 h9 y85 ff4 fs4 fc0 sc0 ls0 ws8"> } </div><div class="t m0 x6 h9 y86 ff4 fs4 fc0 sc0 ls0 ws0">} </div><div class="t m0 x6 h9 y87 ff4 fs4 fc0 sc0 ls0 ws0"> </div><div class="t m0 x6 h8 y88 ff5 fs4 fc0 sc0 ls9 wse">03 8<span class="_ _d"> </span><span class="ff3 sc1 ls0 ws0">只<span class="_ _c"> </span></span><span class="ls1b ws0">LED<span class="_"> </span><span class="ff3 sc1 lsa">左右来回点亮</span><span class="ls0"> </span></span></div><div class="t m0 xf h8 y89 ff5 fs4 fc0 sc0 ls0 ws0"> </div><div class="t m0 x6 h9 y8a ff4 fs4 fc0 sc0 lsc ws2">/* <span class="_ _d"> </span><span class="ff3 ls0 ws0">名称:<span class="ff4">8<span class="_"> </span></span>只<span class="_ _c"> </span><span class="ff4 ls19">LED<span class="_"> </span></span>左右来回点亮<span class="ff4"> </span></span></div><div class="t m0 x6 h9 y8b ff4 fs4 fc0 sc0 ls0 ws0"> <span class="_ _e"> </span><span class="ff3">说明:程序利用循环移位函数</span><span class="ls10">_crol_</span><span class="ff3">和</span><span class="ls1c">_cror_</span><span class="ff3">形成来回滚动的效果</span> </div><div class="t m0 x6 h9 y8c ff4 fs4 fc0 sc0 lsc ws0">*/ </div><div class="t m0 x6 h9 y8d ff4 fs4 fc0 sc0 lsf ws0">#include<reg5<span class="_ _f"></span>1.h> </div><div class="t m0 x6 h9 y8e ff4 fs4 fc0 sc0 lsf ws0">#include<intri<span class="_ _f"></span>ns.h> </div><div class="t m0 x6 h9 y8f ff4 fs4 fc0 sc0 ls10 ws3">#define uchar unsigned char </div><div class="t m0 x6 h9 y90 ff4 fs4 fc0 sc0 lsf ws4">#define uint u<span class="_ _f"></span>nsigned int </div><div class="t m0 x6 h9 y91 ff4 fs4 fc0 sc0 ls11 ws0">//<span class="ff3 ls0">延时<span class="ff4"> </span></span></div><div class="t m0 x6 h9 y92 ff4 fs4 fc0 sc0 ls12 ws5">void DelayM<span class="_ _f"></span>S(uint x) </div><div class="t m0 x6 h9 y93 ff4 fs4 fc0 sc0 ls0 ws0">{ </div><div class="t m0 x6 h9 y94 ff4 fs4 fc0 sc0 ls13 ws6"> uchar <span class="_ _10"></span>i; </div><div class="t m0 x6 h9 y95 ff4 fs4 fc0 sc0 ls14 ws7"> while(x--) </div><div class="t m0 x6 h9 y96 ff4 fs4 fc0 sc0 ls0 ws8"> { </div><div class="t m0 x6 h9 y97 ff4 fs4 fc0 sc0 ls15 ws9"> for(i=0;i<120;i++); </div><div class="t m0 x6 h9 y98 ff4 fs4 fc0 sc0 ls0 ws8"> } </div><div class="t m0 x6 h9 y99 ff4 fs4 fc0 sc0 ls0 ws0">} </div><div class="t m0 x6 h9 y9a ff4 fs4 fc0 sc0 ls11 ws0">//<span class="ff3 ls0">主程序<span class="ff4"> </span></span></div><div class="t m0 x6 h9 y9b ff4 fs4 fc0 sc0 ls10 wsa">void main() </div><div class="t m0 x6 h9 y9c ff4 fs4 fc0 sc0 ls0 ws0">{ </div><div class="t m0 x6 h9 y9d ff4 fs4 fc0 sc0 ls13 ws6"> uchar <span class="_ _10"></span>i; </div><div class="t m0 x6 h9 y9e ff4 fs4 fc0 sc0 ls1d ws10"> P2=0x01; </div><div class="t m0 x6 h9 y9f ff4 fs4 fc0 sc0 lse wsb"> while(1) </div><div class="t m0 x6 h9 ya0 ff4 fs4 fc0 sc0 ls0 ws8"> { </div></div><div class="pi" data-data='{"ctm":[1.611639,0.000000,0.000000,1.611639,0.000000,0.000000]}'></div></div>