Update Garage.ino

This commit is contained in:
2019-02-28 16:30:39 +00:00
parent 3909cea233
commit 82946a6653
+7 -8
View File
@@ -1,7 +1,9 @@
#include "ESP8266WiFi.h" #include "ESP8266WiFi.h"
#include "ESP8266WebServer.h #include "ESP8266WebServer.h"
// https://techtutorialsx.com/2016/10/03/esp8266-setting-a-simple-http-webserver/ // https://techtutorialsx.com/2016/10/03/esp8266-setting-a-simple-http-webserver/
const char* SSID = "LeWe";
const char* PASSWORD = "5275274365464843";
ESP8266WebServer server(80); ESP8266WebServer server(80);
const int remotePin = D1; const int remotePin = D1;
@@ -42,8 +44,8 @@ void loop() {
} }
void handleRequest() { void handleRequest() {
server.send(200, "text/plain", "Triggered"); server.send(200, "text/plain", "Triggered");
triggerAll(); triggerAll();
} }
void triggerAll() { void triggerAll() {
@@ -58,8 +60,8 @@ void triggerAll() {
void connectWifi() { void connectWifi() {
Serial.print("Connecting to "); Serial.print("Connecting to ");
Serial.println(ssid); Serial.println(SSID);
WiFi.begin(ssid, password); WiFi.begin(SSID, PASSWORD);
while (WiFi.status() != WL_CONNECTED) { while (WiFi.status() != WL_CONNECTED) {
delay(500); delay(500);
Serial.print("."); Serial.print(".");
@@ -69,6 +71,3 @@ void connectWifi() {
Serial.println("IP address: "); Serial.println("IP address: ");
Serial.println(WiFi.localIP()); Serial.println(WiFi.localIP());
} }