基于单片机红外线遥控Proteus仿真电路发射接收
【资源下载】下载地址如下1399:
https://docs.qq.com/doc/DTlRSd01BZXNpRUxl
/ // 发射引脚(接PNP三极管b极) // PNP三极管e极接2Ω电阻,c极接红外发射管 #include <REG51.h> #include <intrins.h> #define uchar unsigned char #define uint unsigned int #define SBM 0x80 //识别码 #define m9 (65536-9000) //约9mS #define m4_5 (65536-4500) //约4.5mS #define m1_6 (65536-1630) //约1.65mS #define m_65 (65536-580) //约0.65mS #define m_56 (65536-560) //约0.56mS #define m40 (65536-40000) //约40mS #define m56 (65536-56000) //56mS #define m2_25 (65536-2250) //约2.25mS sbit IR = P3^6; //定义发射引脚(接PNP三极管基极) sbit LED = P3^7; //发射指示灯 uchar KEY(void); void SanZhuan(void); void ZZ(uchar x); void Z0(uchar temp); void TT0(bit BT,uint x); void YS(uchar time);