单片机系统设计与制作技术报告-智能循迹小车设计.docx
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_05.gif)
《单片机系统设计与制作技术报告-智能循迹小车设计.docx》由会员分享,可在线阅读,更多相关《单片机系统设计与制作技术报告-智能循迹小车设计.docx(19页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、设计题目:单片机设计与制作任务书智能循迹小车软件程序:以下为主程序:#include Winclude include include Winclude include #define #define #define define ttdefine #define #define gpio. h“common.h uart hadc.hpit h ftm. hTSL1401_SITSL1401_CLKXDPDHSPAout(7) PAout(8) 0/Sdefine /#define /ftdefine /#define unsigned unsigned unsigned unsigned
2、unsignedmaxL maxR amid xl char char char char char710810760Pixel128; zxLl; zxoldl; oldl;kzl;int csl;int bz 1;/?D?T?e2. 4/?ii p0. 035/ ?u D-1/ ?D?4000/ ?D?/X6Z d?a/6d, d?a/ ?D? u/!?/?D?/ a?D?/a?z ?ey / ? x=b;for(j=0;jf)*(ImageData+j)=d; else*(ImageData+j)=x;for(i=7;i122;i+)if (ImageDatai-2=d & ImageD
3、atai-1=d & ImageDatai=x & ImageDatai+1=d & ImageDatai +2=d)ImageDatai=d;if(ImageDatai-2=x & ImageDatai-l=x &ImageDatai=d & ImageDatai+1=x & ImageDatai+2=x)ImageDatai二x;) for(i=0;i5;i+) /d? ?*(TmageData+i)=x;* (lmageData+127-i)=x;/ void zh (unsigned char * ImageData, unsigned char*zhong,unsigned char
4、 *zhon, int biao)/?D?/(/ unsigned char *b_point;/ int i, m, n;/ int zhcn; /?ey/ unsigned int jumpdot=0;/ unsigned intleft=0;/ unsigned intright=0;/unsigned int tb=O;/zhen=biao;/unsigned int r, z, 1, oldz;/r=0;z=0;1=0;/oldz= *(zhon); zhon a?D zhong ?D/for(i=0;i127;i+)/ /if(ImageDatai!=ImageDatai+l)/j
5、umpdot+;/ )/if(jumpdot=4) /?y3 / /for(i=5;i127;i+)/ /if(ImageDatai!=ImageDatai+l)/ /tb+;/if(tb=2)/e/l=i+l;if( tb=3)r=i;) if( tb=4)if(r-l)20)/ Illi / II / / /z=oldz;)/ ai?*(zhon)=z;z=(l+r) /2;*(zhon)二z;/ )/ )/ )/ )/else/z=oldz;/)/*(zhong)二z;/*(ImageData+z)=240;/jumpdot=0;/)/a?3iDdcharvoid zh (unsigne
6、d char * ImageData, unsigned *zhong, unsigned char *zhon)?D?(unsigned char *b_point;int i, m, n;unsigned int jumpdot=0;unsigned intleft=0;unsigned intright=0;unsigned int tb=O;unsigned int r, z, 1, oldz;r=0;z=0;l=0;oldz= *(zhon); zhon a?D zhong ?Dfor(i=0;i127;i+)if(ImageDatai!=ImageDatai+l)jumpdot+;
7、)if(jumpdot=4) /?y3 for(i=5;i127;i+)(if(ImageDatai!=ImageDatai+l)(tb+;if(tb=2)( l=i+l;)if( tb=3)( r=i;)if( tb=4)( if(r-l)=64) /( 6d?)c=z-64; if(c=XD)c=0;)pw=amid+(c*P- (c-r)*D);if(pw=810)(pw=810; ) else /X6? (c=64-z;if (c=XD)(c=0;pw=amid-(c*P-(c-r)*D); /c bi li r jifen if (pw=30)jianshu=1;*(oldcishu
8、)二cs;) else ( sudu=3500;)if (jianshu=l)if (cs-oldcs)1000&(cs-oldcs)6000) (sudu=3500;jianshu=0;) else (jianshu=0; 6i?uif(jianshu=l&(cs-oldcs)=2000)/ 6 6 u 30o 1?D? ?u?sudu=1500;FTM_PWM_ChangeDuty(HW_FTMO, HW_FTM_CH2, pw);FTM_PWM_ChangeDuty (HW_FTM1, HW_FTM_CH1, S);/ duoji/if(c10)/ lk=3200;/ if(c10)/
9、/Ik=2600;/ )/ if(c20)/ / lk=2800;/ )/int abs(int m)(if (m0)m=m;else m=-m ;return m;unsigned short CRC CHECK(unsigned char *Buf, unsigned char CRC_CNT)unsigned short CRC_Temp;unsigned char i, j;CRC Temp = Oxffff;for (i=O;iCRC_CNT; i+) CRCTemp = Bufi;for (j=0;j 1;) 一return(CRCTemp);void OutPut_Data()(
10、int temp4 = 0;unsigned int tempi4=0;unsigned char databuf10=0;unsigned char i;unsigned short CRC16 = 0;for(i=0;i4;i+)(tempi = (intl6_t)0utDatai;tempii = (uintl6 t)tempi;)for (i=0;i4;i+)unsigned char PIT CNT;unsigned char CT;float 0utData4;int 1;int ccd,zhi;void DELAY Us 1( int x );void ImageCapture(
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 单片机 系统 设计 制作 技术 报告 智能 小车
![提示](https://www.taowenge.com/images/bang_tan.gif)
限制150内