完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
#include #include #include "1602.h" #define NOP() _nop_() /* 定义空指令 */ #define uchar unsigned char #define uint unsigned int #define delayNOP(); {_nop_();_nop_();_nop_();_nop_();}; void delay(uchar x); //x*0.14MS void delay1(int ms); void beep(void); ***it IRIN = P3^3; //红外接收器数据线 ***it RELAY= P1^0; //继电器驱动线 ***it BEEP = P1^1; //蜂鸣器驱动线 uchar IRCOM[7]; uchar cdis1[] = {" REMOTE CONTROL "}; uchar cdis2[] = {" IR-CODE: ----H"}; unsigned char Y0; /*******************************************************************/ main() { uchar m; IE = 0x84; //允许总中断中断,使能 INT1外部中断 TCON = 0x01; //触发方式为脉冲负边沿触发 IRIN=1; //I/O口初始化 BEEP=1; RELAY=1; delay1(10); //延时 lcd_init(); //初始化LCD lcd_pos(0); //设置显示位置为第一行的第1个字符 m = 0; while(cdis1[m] != ' |