-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAutoM.ino
51 lines (49 loc) · 1.15 KB
/
AutoM.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#define ENCODER_DO_NOT_USE_INTERRUPTS
#include <Encoder.h>
#include <ESP8266WiFi.h>
#include <DNSServer.h>
#include <WiFiClient.h>
#include <EEPROM.h>
#include <ESP8266WebServer.h>
///////////////////////////////////////
// OTA
#include <ESP8266mDNS.h>
#include "common.h"
#include "config.h"
#include "webserver.h"
#include "eeprom.h"
#include "wifiSetup.h"
const char* FileName = __FILE__;
void setup()
{
delay(3000);
initHardware();
Serial.write(90);
pinMode(ledPin1, OUTPUT);
digitalWrite(ledPin1, LOW);
//Serial.println("Ready!");
if (loadSavedConfig())
{
if (checkWiFiConnection())
{
SETUP_MODE = false;
startWebServer();
//digitalWrite(ledPin5,HIGH);// Turn the status led Green when the WiFi has been connected
return;
}
}
SETUP_MODE = true;
setupMode();
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void loop()
{
if (WiFi.status() == WL_CONNECTED) {}
if (SETUP_MODE)
{
DNS_SERVER.processNextRequest();
}
WEB_SERVER.handleClient();
//yield();
//heart();
}