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
標簽:
include
110592
120000
define
上傳時間:
2013-12-21
上傳用戶:yph853211