VB遥控播放器红外遥控解码 #include <regX52.h> #define c(x) (x*110592/120000) sbit Ir_Pin=P3^2 sbit beep=P2^1 //sbit RELAY=P2^0 #define INBUF_LEN 4 //数据长度 unsigned char inbuf1[INBUF_LEN]={ 0 , 0 , 0 , 0 } //发送缓冲区 unsigned char inbuf2[50] //接收缓冲区 unsigned char count3 void init_serialcomm( void ) { SCON = 0x50 //SCON: serail mode 1, 8-bit UART, enable ucvr T2CON=0x30 TH2=0x00 TL2=0x00 RCAP2H=0xFF RCAP2L=0xDC TR2=1 } //向串口发送一个字符 void send_char_com( unsigned char ch) { SBUF=ch while (TI== 0 ) TI= 0