• PUDN用户
    了解作者
  • C++
    开发工具
  • 7KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 15
    下载次数
  • 2009-11-20 23:07
    上传日期
基于触摸屏的LED彩色台灯控制系统 触摸屏ADS7843 单片机ATmega48
ATmega48.rar
  • ATmega48.doc
    42.5KB
内容介绍
<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/622baa3b15da9b288b4afdf7/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/622baa3b15da9b288b4afdf7/bg1.jpg"><div class="c x0 y1 w2 h2"><div class="t m0 x1 h3 y2 ff1 fs0 fc0 sc0 ls0 ws0">#include &lt;iom48v<span class="_ _0"></span>.h&gt;</div><div class="t m0 x1 h3 y3 ff1 fs0 fc0 sc0 ls0 ws0">#include &lt;macros.h&gt;</div><div class="t m0 x1 h3 y4 ff1 fs0 fc0 sc0 ls0 ws0">#include &lt;delay<span class="_ _0"></span>.h&gt;</div><div class="t m0 x1 h3 y5 ff1 fs0 fc0 sc0 ls0 ws0">#include &lt;lcdcom_48.h&gt;</div><div class="t m0 x1 h4 y6 ff1 fs0 fc0 sc0 ls0 ws0">//mega48<span class="_ _1"> </span><span class="ff2">&#19987;&#29992;<span class="_ _1"> </span></span>LED<span class="_ _1"> </span><span class="ff2">&#39537;&#21160;</span></div><div class="t m0 x1 h3 y7 ff1 fs0 fc0 sc0 ls0 ws0">#define MOSI POR<span class="_ _0"></span>TB3</div><div class="t m0 x1 h3 y8 ff1 fs0 fc0 sc0 ls0 ws0">#define SCK POR<span class="_ _0"></span>TB5</div><div class="t m0 x1 h4 y9 ff1 fs0 fc0 sc0 ls0 ws0">#define lcd_xmax 38 //X<span class="_ _1"> </span><span class="ff2">&#36724;&#20998;&#26684;</span></div><div class="t m0 x1 h4 ya ff1 fs0 fc0 sc0 ls0 ws0">#define lcd_ymax 29 //Y<span class="_ _1"> </span><span class="ff2">&#36724;&#20998;&#26684;</span></div><div class="t m0 x1 h3 yb ff1 fs0 fc0 sc0 ls0 ws0">unsigned int ads7843_x,ads7843_y<span class="_ _0"></span>,ads7843;</div><div class="t m0 x1 h3 yc ff1 fs0 fc0 sc0 ls0 ws0">unsigned int ads7843_xmin,ads7843_ymin;</div><div class="t m0 x1 h3 yd ff1 fs0 fc0 sc0 ls0 ws0">unsigned int ads7843_xmax,ads7843_ymax;</div><div class="t m0 x1 h3 ye ff1 fs0 fc0 sc0 ls0 ws0">unsigned int ads7843_xts,ads7843_yts;</div><div class="t m0 x1 h3 yf ff1 fs0 fc0 sc0 ls0 ws0">unsigned char coun,coun1;</div><div class="t m0 x1 h3 y10 ff1 fs0 fc0 sc0 ls0 ws0">unsigned char lcd_x,lcd_y;</div><div class="t m0 x1 h3 y11 ff1 fs0 fc0 sc0 ls0 ws0">unsigned char udr_rgb[6];</div><div class="t m0 x1 h3 y12 ff1 fs0 fc0 sc0 ls0 ws0">unsigned char udr_count;</div><div class="t m0 x1 h3 y13 ff1 fs0 fc0 sc0 ls0 ws0">unsigned char udr;</div><div class="t m0 x1 h3 y14 ff1 fs0 fc0 sc0 ls0 ws0">unsigned char color_r<span class="_ _2"></span>,color_g,color_b;</div><div class="t m0 x1 h3 y15 ff1 fs0 fc0 sc0 ls0 ws0">//*****************************************************************//</div><div class="t m0 x1 h4 y16 ff1 fs0 fc0 sc0 ls0 ws0">//<span class="ff2">&#21517;</span> <span class="ff2">&#31216;&#65306;</span>IO<span class="_ _1"> </span><span class="ff2">&#21475;&#21021;&#22987;&#21270;&#20989;&#25968;</span></div><div class="t m0 x1 h4 y17 ff1 fs0 fc0 sc0 ls0 ws0">//<span class="ff2">&#21151;</span> <span class="ff2">&#33021;&#65306;&#21021;&#22987;&#21270;&#21333;&#29255;&#26426;&#36755;&#20837;&#36755;&#20986;&#21475;</span></div><div class="t m0 x1 h3 y18 ff1 fs0 fc0 sc0 ls0 ws0">//*****************************************************************//</div><div class="t m0 x1 h3 y19 ff1 fs0 fc0 sc0 ls0 ws0">void port_init(void)</div><div class="t m0 x1 h3 y1a ff1 fs0 fc0 sc0 ls0 ws0">{</div><div class="t m0 x1 h3 y1b ff1 fs0 fc0 sc0 ls0 ws0"> <span class="_ _3"> </span> POR<span class="_ _0"></span>TB = 0xFF;</div><div class="t m0 x1 h3 y1c ff1 fs0 fc0 sc0 ls0 ws0"> <span class="_ _3"> </span> DDRB = 0xFF;</div><div class="t m0 x1 h3 y1d ff1 fs0 fc0 sc0 ls0 ws0"> <span class="_ _3"> </span> POR<span class="_ _0"></span>TC = 0x70; </div><div class="t m0 x1 h3 y1e ff1 fs0 fc0 sc0 ls0 ws0"> <span class="_ _3"> </span> DDRC = 0x0F;</div><div class="t m0 x1 h3 y1f ff1 fs0 fc0 sc0 ls0 ws0"> <span class="_ _3"> </span> POR<span class="_ _0"></span>TD = 0x00;</div><div class="t m0 x1 h3 y20 ff1 fs0 fc0 sc0 ls0 ws0"> <span class="_ _3"> </span> DDRD = 0xFF;</div><div class="t m0 x1 h3 y21 ff1 fs0 fc0 sc0 ls0 ws0">}</div><div class="t m0 x1 h3 y22 ff1 fs0 fc0 sc0 ls0 ws0">//*****************************************************************//</div><div class="t m0 x1 h4 y23 ff1 fs0 fc0 sc0 ls0 ws0">//<span class="ff2">&#21517;</span> <span class="ff2">&#31216;&#65306;&#23450;&#26102;&#22120;<span class="_ _1"> </span></span>1<span class="_ _1"> </span><span class="ff2">&#21021;&#22987;&#21270;</span></div><div class="t m0 x1 h4 y24 ff1 fs0 fc0 sc0 ls0 ws0">//<span class="ff2">&#24037;&#20316;&#27169;&#24335;&#65306;&#26368;&#22823;&#20540;&#20026;<span class="_ _1"> </span></span>255<span class="_ _1"> </span><span class="ff2">&#30340;&#24555;&#36895;<span class="_ _1"> </span></span>PW<span class="_ _2"></span>M</div><div class="t m0 x1 h4 y25 ff1 fs0 fc0 sc0 ls0 ws0">//<span class="ff2">&#36755;&#20986;&#39057;&#29575;&#65306;</span>31250.000Hz</div><div class="t m0 x1 h3 y26 ff1 fs0 fc0 sc0 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>
评论
    相关推荐