Create wifi_setup.h

This commit is contained in:
Ross 'H3ALY' Healy
2024-10-19 09:24:06 +01:00
committed by GitHub
parent 3aa4af853a
commit 1856c56799

26
wifi_setup.h Normal file
View File

@@ -0,0 +1,26 @@
#ifndef WIFI_SETUP_H
#define WIFI_SETUP_H
#include <ESP8266WiFi.h>
#include "config.h"
class WiFiManager {
public:
void setup_wifi() {
Serial.print("Connecting to ");
Serial.print(ssid); // Use Serial.print instead of Serial.println
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
}
};
#endif