Added WiFi connection
This commit is contained in:
parent
3824999721
commit
0b7c66a684
@ -7,6 +7,10 @@
|
||||
|
||||
Epd epd;
|
||||
|
||||
// WiFi
|
||||
char wiFiSSID[] = "SSID"; // SSID of your network
|
||||
char wiFiPSK[] = "PRE-SHARED KEY"; //password of your WPA Network
|
||||
|
||||
// style of the frame shown
|
||||
sFONT TITLE_FONT = Font20;
|
||||
char TITLE_TEXT[] = "Losung heute";
|
||||
@ -34,4 +38,5 @@ void setup() {
|
||||
}
|
||||
|
||||
void loop() {
|
||||
connectWiFi();
|
||||
}
|
||||
|
15
wifi.ino
Normal file
15
wifi.ino
Normal file
@ -0,0 +1,15 @@
|
||||
#include <WiFi.h>
|
||||
|
||||
void connectWiFi() { // connect to the wifi with the above defined credentials
|
||||
if(WiFi.status() == WL_CONNECTED) { return; } // return if not connected
|
||||
|
||||
Serial.println("Connecting to WiFi...");
|
||||
|
||||
WiFi.begin(wiFiSSID, wiFiPSK);
|
||||
delay(5000); // pause the program 5 secs to give time for connection
|
||||
if(WiFi.status() != WL_CONNECTED) { return; }
|
||||
Serial.printf("Connected to WiFi %s, got IP-Adress ", wiFiSSID);
|
||||
Serial.println(WiFi.localIP());
|
||||
|
||||
return;
|
||||
}
|
Loading…
Reference in New Issue
Block a user