概述
wifi模块01_AT指令
先通过连接wifi从而连接网络,再连接服务器
#include "reg52.h"
#include "intrins.h"
#include <string.h>
#define SIZE 12
sfr AUXR = 0x8E;
sbit D5 = P3^7;
char cmd[SIZE];
code char LJWL[]
= "AT+CWJAP="TP-LINK_3E30","18650711783"rn";
code char LJFWQ[] = "AT+CIPSTART="TCP","192.168.0.113",8880rn";
char TCMS[]
= "AT+CIPMODE=1rn";
char SJCS[]
= "AT+CIPSENDrn";
void UartInit(void)
//9600bps@11.0592MHz
{
AUXR = 0x01;
SCON = 0x50; //配置串口工作方式1,REN使能接收
TMOD &= 0xF0;
TMOD |= 0x20;//定时器1工作方式位8位自动重装
TH1 = 0xFD;
TL1 = 0xFD;//9600波特率的初值
TR1 = 1;//启动定时器
EA = 1;//开启总中断
ES = 1;//开启串口中断
}
void Delay1000ms()
//@11.0592MHz
{
unsigned char i, j, k;
_nop_();
i = 8;
j = 1;
k = 243;
do
{
do
{
while (--k);
} while (--j);
} while (--i);
}
void sendByte(char data_msg)
{
SBUF = data_msg;
while(!TI);
TI = 0;
}
void sendString(char* str)
{
while( *str != '