请教一编程
#include <reg52.h>#include <intrins.h>
#define uint8 unsigned char
#define uint16 unsigned int
#define shuama P0
sbit dianji11=P1^4;
sbit dianji12=P1^5;
sbit dianji21=P3^4;
sbit dianji22=P3^5;
void UART_init() /????
{
PCON=0X80;
TMOD = 0x20; //T1????2 8?????
TH1 = 0xFd;
TL1 = 0xFd; //???19200
TR1 = 1; //??T1???
SM0 = 0;
SM1 = 1; //??????1 10???
REN = 1; //??????
ES = 1; //??????
EA = 1; // ????
}
uint8 num,m;
void main() //?????
{
UART_init();
while(1)
{
}
}
void UART() interrupt 4
{
if(RI) //????????
{
num =SBUF; //num?????????
RI=0;
if(num==0x01)
{
dianji11=1;
dianji12=0;
dianji21=1;
dianji22=0; }
if(num==0x02)
{
dianji12=1;
dianji11=0;
dianji21=0;
dianji22=1;
}
if(num==0x03)
{
dianji11=1;
dianji12=0;
dianji21=0;
dianji22=1;
}
if(num==0x04)
{
dianji11=0;
dianji12=1;
dianji21=1;
dianji22=0;
}
if(num==0x05)
{
dianji11=0;
dianji12=0;
dianji21=0;
dianji22=0;
}
SBUF=num;
while(!TI);
TI=0;
}
}
怎么改可以实现用蓝牙控制,这个是串口控制!