初级会员
- 积分
- 60
- 金钱
- 60
- 注册时间
- 2017-9-4
- 在线时间
- 5 小时
|
楼主 |
发表于 2017-9-26 15:25:33
|
显示全部楼层
void atk_8266_mtest_ui(u16 x,u16 y)
{
LCD_Clear(WHITE);
POINT_COLOR=RED;
Show_Str_Mid(0,y,"ATK_ESP8266 WIFIÄ£¿é2aêÔ",16,240);
Show_Str(x,y+25,200,16,"ÇëÑ¡Ôñ:",16,0);
Show_Str(x,y+45,200,16,"KEY0:WIFI STA+AP",16,0);
Show_Str(x,y+65,200,16,"KEY1:WIFI STA",16,0);
Show_Str(x,y+85,200,16,"WK_UP:WIFI AP",16,0);
atk_8266_msg_show(x,y+125,0);
}
//ATK-ESP8266Ä£¿é2aêÔÖ÷oˉêy
void atk_8266_test(void)
{
// u16 rlen=0;
u8 key;
u8 timex;
POINT_COLOR=RED;
Show_Str_Mid(0,30,"ATK-ESP8266 WIFIÄ£¿é2aêÔ",16,240);
while(atk_8266_send_cmd("AT","OK",20))//¼ì2éWIFIÄ£¿éêÇ·ñÔúÏß
{
atk_8266_quit_trans();//íË3öí¸′«
atk_8266_send_cmd("AT+CIPMODE=0","OK",200); //1رÕí¸′«Ä£ê½
Show_Str(40,55,200,16,"Î′¼ì2aμ½Ä£¿é!!!",16,0);
delay_ms(800);
LCD_Fill(40,55,200,55+16,WHITE);
Show_Str(40,55,200,16,"3¢êÔᬽóÄ£¿é...",16,0);
}
while(atk_8266_send_cmd("ATE0","OK",20));//1رջØÏÔ
atk_8266_mtest_ui(32,30);
while(1)
{
delay_ms(10);
atk_8266_at_response(1);//¼ì2éATK-ESP8266Ä£¿é·¢Ëí1yà′μÄêy¾Y,¼°ê±éÏ′«¸øμçÄÔ
key=KEY_Scan(0);
if(key)
{
LCD_Clear(WHITE);
POINT_COLOR=RED;
switch(key)
{
case 1://KEY0
Show_Str_Mid(0,30,"ATK-ESP WIFI-AP+STA 2aêÔ",16,240);
Show_Str_Mid(0,50,"ÕyÔúÅäÖÃATK-ESP8266Ä£¿é£¬ÇëéÔμè...",12,240);
atk_8266_apsta_test(); //′®¿úòÔì«íø2aêÔ
break;
case 2://KEY1
Show_Str_Mid(0,30,"ATK-ESP WIFI-STA 2aêÔ",16,240);
Show_Str_Mid(0,50,"ÕyÔúÅäÖÃATK-ESP8266Ä£¿é£¬ÇëéÔμè...",12,240);
atk_8266_wifista_test();//WIFI STA2aêÔ
break;
case 4://WK_UP
atk_8266_wifiap_test(); //WIFI AP2aêÔ
break;
}
atk_8266_mtest_ui(32,30);
timex=0;
}
if((timex%20)==0)LED0=!LED0;//200mséá˸
timex++;
}
} |
|