51单片机格力空调遥控器.doc

51单片机格力空调遥控器.doc

ID:48517078

大小:41.00 KB

页数:12页

时间:2020-01-26

51单片机格力空调遥控器.doc_第1页
51单片机格力空调遥控器.doc_第2页
51单片机格力空调遥控器.doc_第3页
51单片机格力空调遥控器.doc_第4页
51单片机格力空调遥控器.doc_第5页
资源描述:

《51单片机格力空调遥控器.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、.1.//51单片机格力空调遥控器2.3.#include 4.#include5.#defineucharunsignedchar6.#defineuint  unsignedint 7.#defineenTransmitt  flag=18.#definedisTransmitt  flag=09.sfr  T2MOD  =0XC9;10.bit  flag=0;11.sbitIR38k=P2^3;    //红外发射管12.sbitkey1=P1^1;13.sbitkey2=P1^3;14.sbitkey3=P1^5;15.sbitkey4=P

2、1^7;16.sbitkey5=P1^0;17.sbitkey6=P1^4;18.ucharKeyScan();19.uint  count=0,set_count=0;20.ucharfengliang_value=0;21.ucharkey_value=0;22.ucharwendu_value=0;23.ucharmode_value=0;24.ucharswitch_value=0;25.ucharzhuanye_value=0;26.ucharcodezhuanye[][5]={{0x39,0x04,0x00,0x50,0x02},{0x79,0x04,0x00,0x50,0x0

3、2}};  //手动,自动转页(20度,冷气)27.ucharcode  fengliang[][5]={{0x28,0x08,0x00,0x50,0x02},{0x19,0x08,0x00,0x50,0x02},28.                    {0x09,0x08,0x00,0x50,0x02} 29.      };//自动模式风量小,中,大  (20度)..1.ucharcode  mode[][5]={  2.                {0x58,0x00,0x00,0x50,0x02},{0x59,0x04,0x00,0x50,0x02},3.    {0x5

4、a,0x04,0x00,0x50,0x02},{0x5b,0x04,0x00,0x50,0x02}4.              };  //自动,冷气,除湿,送风5./*ucharcode  on_or_off[][5]={{0x40,0x00,0x00,0x50,0x02},{0x48,0x00,0x00,0x50,0x02}};*/6.ucharcode  on_or_off[][5]={7.    {0x39,0x08,0x00,0x50,0x02},{0x31,0x08,0x00,0x50,0x02}, 8.                  {0x59,0x08,0x00,0x

5、50,0x02},{0x51,0x08,0x00,0x50,0x02},9.    {0x79,0x08,0x00,0x50,0x02},{0x71,0x08,0x00,0x50,0x02}, 10.    };//开机,关机11.ucharcode  wendu[][5]={12.              {0x59,0x00,0x00,0x50,0x02},{0x59,0x01,0x00,0x50,0x02},13.      {0x59,0x02,0x00,0x50,0x02},{0x59,0x03,0x00,0x50,0x02},14.      {0x59,0x04,0x00,

6、0x50,0x02},{0x59,0x05,0x00,0x50,0x02},15.      {0x59,0x06,0x00,0x50,0x02},{0x59,0x07,0x00,0x50,0x02},16.      {0x59,0x08,0x00,0x50,0x02},{0x59,0x09,0x00,0x50,0x02},17.      {0x59,0x0a,0x00,0x50,0x02},{0x59,0x0b,0x00,0x50,0x02},18.      {0x59,0x0c,0x00,0x50,0x02},{0x59,0x0d,0x00,0x50,0x02},19.     

7、 {0x59,0x0e,0x00,0x50,0x02}  20.                };//温度值 21.22.voidsend_precode(unsignedints_cnt_1,unsignedints_cnt_2);23.voidsend_8bit_code(ucharvalue);24.voidsend_4bit_code(ucharvalue);25.voidsend_final_code();2

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

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

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