|
arduino uno + 8针 8266 wifi模块
(8266 链接 :http://detail.tmall.com/item.htm ... 325js995740&mt=)
首先我下载了 8266驱动放在了arduino-1.5.7\libraries\ITEADLIB_ESP8266_c\ 下
arduino + 8266 我连接了 vcc 3.3 ;ch_pd 3.3;gnd ;urxd 9;utxd 10 ,然后
#define _DBG_RXPIN_ 10 //A0
#define _DBG_TXPIN_ 9 //A1
运行代码:
void setup()
{
Serial.begin(9600);
Serial.println("Init 001");
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
pinMode(6,OUTPUT);
pinMode(7,OUTPUT);
Serial.println("Init 002");
wifi.begin();
Serial.println("Init 003");
bool b = wifi.Initialize(STA, SSID, PASSWORD);
if(!b)
{
Serial.println("Init error");
}
Serial.println("Init no error");
delay(8000); //make sure the module can have enough time to get an IP address
String ipstring = wifi.showIP();
Serial.println(ipstring); //show the ip address of module
delay(2000);
wifi.confMux(1);
delay(100);
if(wifi.confServer(1,8080))
Serial.println("Server is set up");
}
void loop()
{}
运行效果:
Init 001
Init 002
AT+RST
然后就没有了 卡在这里了,代码无法调试我抑郁。。
请教大神 |
|