Procházet zdrojové kódy

Secret wifi password

Emil před 3 roky
rodič
revize
753ef94fab
2 změnil soubory, kde provedl 13 přidání a 3 odebrání
  1. 11 0
      src/WiFiPass.h
  2. 2 3
      src/main.cpp

+ 11 - 0
src/WiFiPass.h

@@ -0,0 +1,11 @@
+//
+// Created by emilr on 2022-05-08.
+//
+
+#ifndef UNTITLED_WIFIPASS_H
+#define UNTITLED_WIFIPASS_H
+
+#define SSID "INTERNET_SSID_HERE"
+#define PASSWORD "INTERNET_PASSWORD_HERE"
+
+#endif //UNTITLED_WIFIPASS_H

+ 2 - 3
src/main.cpp

@@ -1,5 +1,6 @@
 #include "main.h"
 #include "LightCluster.h"
+#include "WiFiPass.h"
 
 #include <WiFi.h>
 #include <../.pio/libdeps/esp32doit-devkit-v1/AsyncTCP/src/AsyncTCP.h>
@@ -11,8 +12,6 @@
 
 uint32_t lastIrReceive = 0;
 
-const char* ssid = "REPLACE_WITH_YOUR_SSID";
-const char* password = "REPLACE_WITH_YOUR_PASSWORD";
 AsyncWebServer server(80);
 
 Adafruit_NeoPixel leds(NUM_LEDS, LED_PIN, NEO_WRGB + NEO_KHZ800);
@@ -31,7 +30,7 @@ LightCluster myCluster2(lampsInCluster2, 2, 0, &animation2);
 
 void connectWiFi() {
     WiFi.mode(WIFI_STA);
-    WiFi.begin(ssid, password);
+    WiFi.begin(SSID, PASSWORD);
     Serial.print("Connecting to WiFi ..");
     while (WiFi.status() != WL_CONNECTED) {
         Serial.print('.');