added simple auto connect example

This commit is contained in:
Alex Tudorache
2015-08-01 09:06:25 +03:00
parent 68da7c699f
commit 4610c4db11
+30
View File
@@ -0,0 +1,30 @@
#include <ESP8266WiFi.h> //https://github.com/esp8266/Arduino
//needed for library
#include <EEPROM.h>
#include <ESP8266mDNS.h>
#include <WiFiManager.h> //https://github.com/tzapu/WiFiManager
//this intitilises the library, parameter is eeprom start
WiFiManager wifi(0);
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
//WiFiManager
//fetches ssid and pass from eeprom and tries to connect
//if it does not connect it starts an access point with the specified name
//here "AutoConnectAP"
//and goes into a blocking loop awaiting configuration
wifi.autoConnect("AutoConnectAP");
//if you get here you have connected to the WiFi
Serial.println("connected...yeey :)");
}
void loop() {
// put your main code here, to run repeatedly:
}