123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- #include <ESP8266WiFi.h> //https://github.com/esp8266/Arduino
- #include <ESP8266WebServer.h>
- #include <DNSServer.h>
- #include <WiFiManager.h> //https://github.com/tzapu/WiFiManager
- #define TRIGGER_PIN 0
- void setup() {
-
- Serial.begin(115200);
- Serial.println("\n Starting");
- pinMode(TRIGGER_PIN, INPUT);
- }
- void loop() {
-
- if ( digitalRead(TRIGGER_PIN) == LOW ) {
-
-
- WiFiManager wifiManager;
-
-
-
-
-
-
-
-
-
-
-
-
- if (!wifiManager.startConfigPortal("OnDemandAP")) {
- Serial.println("failed to connect and hit timeout");
- delay(3000);
-
- ESP.reset();
- delay(5000);
- }
-
- Serial.println("connected...yeey :)");
- }
-
- }
|