pic 16 操作esp8266

2019-04-15 15:57发布



unsigned char  AT[]="AT ";                                                        //  联机指令,返回"OK"
unsigned char  wifi_mode[]="AT+CWMODE=2 ";                                               //  设置ESP8266的工作模式,返回"OK"或者"no change"
unsigned char  wifi_cipmux[]="AT+CIPMUX=1 "; 
unsigned char  cipserver[]="AT+CIPSERVER=1,8080 ";
const char  wifi_cwsap[]="AT+CWSAP="Westinghouse","88888888",2,3 ";      //  连接到WiFi热点,Westinghouse为热点名称,88888888为密码;频道 2 加密方式WPA2_PSK连接成功返回“OK”     
unsigned char  wifi_send_0[]={"AT+CIPSEND=0,43 "};                      //  发送数据指令
unsigned char  wifi_send_1[]="AT+CIPSEND=1,43 ";
//unsigned char  wifi_send_2[]="AT+CIPSEND=2,43 ";
//unsigned char  wifi_send_3[]="AT+CIPSEND=3,43 ";
//unsigned char  wifi_send_4[]="AT+CIPSEND=4,43 ";
unsigned char  wifi_rst[]="AT+RST ";