51单片机自动控制升旗系统

51单片机自动控制升旗系统

ID:40521571

大小:77.00 KB

页数:11页

时间:2019-08-04

51单片机自动控制升旗系统_第1页
51单片机自动控制升旗系统_第2页
51单片机自动控制升旗系统_第3页
51单片机自动控制升旗系统_第4页
51单片机自动控制升旗系统_第5页
资源描述:

《51单片机自动控制升旗系统》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、/**********************51单片机升旗系统***************************//**************步进电机升旗和降旗,蜂鸣器奏国歌,******************//***************数码管显示系统时间和高度***************************/#include#defineuintunsignedint#defineucharunsignedcharucharcodeFFW[]={0x01,

2、0x03,0x02,0x06,0x04,0x0c,0x08,0x09};//正转的步码ucharcodeREV[]={0x09,0x08,0x0c,0x04,0x06,0x02,0x03,0x01};//反转的步码ucharth[]={0x0f,0x5d,0xab};//3个定时器值,高8位uchartl[]={0xa0,0xc0,0xe0};//3个定时器值,低8位codeucharSZ[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};

3、//数码管unsignedintcodeFreqTab1[]={64216,64360,64489,64547,64654,64752,64837,64876,64948,65012,65042,65095,65144,65186,65206,65242,65274,65289,65135,65340,65361,};unsignedintcodeFreqTab[]={//简谱对应的简谱码、T值65535,64260,64400,64524,64579,64685,64778,64860,6489

4、8,64968,65030,65057,65110,65157,65198,65217,65252,65283,65297,65323,65346,65367,};unsignedcharcodeyyjjxq[]={8,0x08,0,0x04,5,0x04,8,0x0c,8,0x04,8,0x06,8,0x02,5,0x04,6,0x02,7,0x02,8,0x08,8,0x08,0,0x04,10,0x04,8,0x04,9,0x02,10,0x02,//10,0x04,10,0x04,8,0x

5、04,9,0x02,10,0x02,12,0x08,12,0x08,10,0x06,10,0x02,8,0x06,10,0x02,12,0x06,10,0x02,9,0x08,//12,0x10,9,0x10,13,0x08,12,0x08,9,0x08,10,0x08,12,0x04,10,0x04,0,0x04,12,0x04,//12,0x04,10,0x04,10,0x04,12,0x04,10,0x04,9,0x02,10,0x02,8,0x08,10,0x08,0,0x08,//10,

6、0x08,10,0x08,5,0x06,6,0x04,8,0x04,8,0x04,10,0x06,10,0x02,12,0x04,12,0x04,9,0x04,9,0x02,9,0x02,6,0x08,9,0x0c,5,0x04,8,0x0c,8,0x04,10,0x0c,10,0x04,12,0x10,8,0x06,10,0x02,12,0x04,12,0x04,13,0x08,12,0x08,10,0x06,8,0x02,12,0x08,10,0x04,0,0x04,8,0x04,0,0x04

7、,//10,0x04,10,0x04,8,0x04,8,0x04,5,0x08,8,0x08,10,0x06,8,0x02,12,0x08,10,0x04,0,0x04,8,0x04,0,0x04,//10,0x04,10,0x04,8,0x04,8,0x04,5,0x08,8,0x08,5,0x08,8,0x08,5,0x08,8,0x08,8,0x08,0,0x08,//8,0x08,0xff,0xff,};ucharspeed_count=2;ucharflag=0;bittimer_fla

8、g=0;bitMOTOR_FFW_FLAG=0;bitMOTOR_REV_FLAG=0;sbitK1=P3^0;//正转sbitK2=P3^1;//反转sbitK5=P3^4;//停止sbitled1=P2^0;sbitled2=P2^1;sbitled3=P2^2;sbitled4=P2^3;sbitled5=P2^4;sbitled6=P2^5;sbitbeep=P3^7;voidsmg_display();voidK1_stop_state();voidK2_stop_sta

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。