WordClockESP/src/main.cpp

33 lines
655 B
C++
Raw Normal View History

#include <ESP8266React.h>
2021-03-06 22:06:09 +01:00
#include "ClockService.h"
#define SERIAL_BAUD_RATE 115200
// version info
#define VERSION "v0.1.0"
AsyncWebServer server(80);
ESP8266React esp8266React(&server);
2021-03-06 22:06:09 +01:00
ClockService cservice = ClockService(&server, esp8266React.getSecurityManager());
void setup() {
2019-08-09 15:53:39 +01:00
// start serial and filesystem
Serial.begin(SERIAL_BAUD_RATE);
2021-03-07 18:04:02 +01:00
Serial.printf("Starting WordClock %s", VERSION);
// start the framework and demo project
esp8266React.begin();
// load the initial light settings
2021-03-06 22:06:09 +01:00
cservice.begin();
2019-08-09 15:53:39 +01:00
// start the server
server.begin();
}
void loop() {
2019-08-09 15:53:39 +01:00
// run the framework's loop function
esp8266React.loop();
}