单片机发送红外遥控码

本文介绍了一个使用单片机控制数码相框或广告机的程序,重点在于如何编写发送红外遥控码的软件。作者提供了头文件和C文件的代码示例,详细解释了红外码的生成和发送过程,适合单片机新手参考。
摘要由CSDN通过智能技术生成

    前不久,要用单片机做一个发送红外遥控码的程序,以前只搞硬件,第一次作软件,不知所以然,想到网上参考一下,结果找来找去总是那么一个,还是用汇编写的,看了很久不知讲些什么,只好自己写了。在此给像我一样的新手一个参考,分享一下。

    这个程序主要是用单片机来控制数码相框(或广告机),利用人体红外探头检测是否有人移动,然后根据用记所选择的模式来控制数码相框(或广告机)的工作状态。

    代码如下:

    以下是头文件:

  1. //
  2. //
  3. // this header file is programmed by hdl ,
  4. // maybe there are something that is not correct ,
  5. // please connect me when come accross problem ,
  6. // e_mail:de_12@163.com
  7. //
  8. //
  9. // the following is header file
  10. //
  11. // if you use any other [single chip computer] or [PIC] ,
  12. // please change this header file only , you don not hava to 
  13. // change the [C] file
  14. //
  15. // programmed on 2008 - 08 - 29
  16. //
  17. // single chip computer [holtek ht48f06e] , web site : http://www.holtek.com.tw ; http://www.holtek.com.cn
  18. //
  19. //
  20. #ifndef haodl_h_file                    
  21. #define haodl_h_file                    
  22. #ifndef hdl_inlcude_ht48f06e
  23.     #include "ht48f06e.h"                                           
  24.     #define hdl_inlcude_ht48f06e
  25.     #define single_chip_is_ht48f06e 1
  26.     #define __mod_can_change_by_key__                                   
  27. #endif
  28. #ifdef __mod_can_change_by_key__
  29.     #define keychange 0
  30.     #define plugchange 1
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值