esp8266返回的数据通过数组接收,但是在串口显示确是一直为空大家帮我看看,这是为啥啊
代码如下
unsigned char Usart_Receive[50]={0};
unsigned char Usart_Cnt=0;
void Init(void)
{
PCON &=0X00;
SCON = 0X50;
AUXR |= 0x40;
AUXR &= 0xFE;
TMOD &= 0x0F;
TMOD |= 0x20;
TL1 = 0xDC;
TH1 = 0xDC;
ET1 = 0;
TR1 = 1;
EA = 1;
ES = 1;
REN=1;
}
void main()
{
Init();
ESP8266_Init_weather();
AT_Send_String(Usart_Receive);
led = ~led;
while(1);
}
void InterruptUART(void) interrupt 4
{
if(RI)
{
Usart_Receive[Usart_Cnt]=SBUF;
Usart_Cnt++;
RI=0;
}
if(*Usart_Receive!=NULL)
{
if(Usart_Receive[Usart_Cnt]=='\0')
{
led = ~led;
Usart_Cnt=0;
Usart_AT_flage=1;
}
}
else
TI=0;
}
/*
>{"cityid":"101300101","city":"???","update_time":"16:49","wea":"??","wea_img":"wu","tem":"23","tem_day":"26",
"tem_night":"16","win":"???","win_speed":"2??","win_meter":"7km\/h","air":"93"}*/
//数据格式
|