add dummy webserver
This commit is contained in:
parent
bd35a357a1
commit
5d263b9657
1 changed files with 13 additions and 0 deletions
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include <WiFi.h>
|
||||
#include "wifi_login.h"
|
||||
#include <WebServer.h>
|
||||
|
||||
#include <U8g2lib.h>
|
||||
|
||||
|
@ -15,6 +16,8 @@
|
|||
|
||||
#include <Adafruit_SGP30.h>
|
||||
|
||||
WebServer server(80);
|
||||
|
||||
Preferences preferences;
|
||||
|
||||
U8G2_SSD1327_WS_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 17, /* dc=*/ 3, /* reset=*/ 16);
|
||||
|
@ -99,6 +102,14 @@ void setup() {
|
|||
u8g2log.print("\n");
|
||||
u8g2log.print("\n");
|
||||
|
||||
//Init Server
|
||||
server.onNotFound(
|
||||
[]() {
|
||||
server.send(404, "text/plain", "Content not found\n");
|
||||
}
|
||||
);
|
||||
server.begin();
|
||||
|
||||
//Init BME280 sensor
|
||||
Wire.begin();
|
||||
|
||||
|
@ -167,6 +178,8 @@ int elapsed_minutes = 0;
|
|||
int elapsed_hours = 0;
|
||||
void loop() {
|
||||
|
||||
server.handleClient();
|
||||
|
||||
//Clear screen
|
||||
u8g2log.print("\f");
|
||||
|
||||
|
|
Loading…
Reference in a new issue