Welcome![Sign In][Sign Up]
Location:
Search - VB player remote control infrared remote control d

Search list

[SCMchip1

Description: 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-VB player remote control infrared remote control decoder# 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// data length unsigned char inbuf1 [INBUF_LEN] = (0, 0, 0, 0)// Send buffer unsigned char inbuf2 [50]// receive buffer unsigned char count3 void init_serialcomm (void) ( SCON = 0x50// SCON: serail mode 1, 8-bit UART, enable ucvrT2CON = 0x30 TH2 = 0x00 TL2 = 0x00 RCAP2H = 0xFF RCAP2L = 0xDC TR2 = 1)// to send a serial character void send_char_com (unsigned char ch ) (SBUF = ch while (TI == 0) TI = 0
Platform: | Size: 12667904 | Author: 微微 | Hits:

CodeBus www.codebus.net