update readme with changes to the demo code

This commit is contained in:
Rick Watson 2019-09-30 21:38:44 +01:00
parent 41f7579bd5
commit d0fb2d982a
2 changed files with 12 additions and 8 deletions

View File

@ -262,8 +262,8 @@ The following code creates the web server, esp8266React framework and the demo p
```cpp ```cpp
AsyncWebServer server(80); AsyncWebServer server(80);
ESP8266React framework(&SPIFFS); ESP8266React esp8266React(&server, &SPIFFS);
DemoProject demoProject = DemoProject(&SPIFFS, framework.getSecurityManager()); DemoProject demoProject = DemoProject(&server, &SPIFFS, esp8266React.getSecurityManager());
``` ```
Now in the `setup()` function the initialization is performed: Now in the `setup()` function the initialization is performed:
@ -272,13 +272,15 @@ Now in the `setup()` function the initialization is performed:
void setup() { void setup() {
// start serial and filesystem // start serial and filesystem
Serial.begin(SERIAL_BAUD_RATE); Serial.begin(SERIAL_BAUD_RATE);
// start the file system (must be done before starting the framework)
SPIFFS.begin(); SPIFFS.begin();
// set up the framework // start the framework and demo project
framework.init(&server); esp8266React.begin();
// begin the demo project // start the demo project
demoProject.init(&server); demoProject.begin();
// start the server // start the server
server.begin(); server.begin();
@ -290,7 +292,7 @@ Finally the loop calls the framework's loop function to service the frameworks f
```cpp ```cpp
void loop() { void loop() {
// run the framework's loop function // run the framework's loop function
framework.loop(); esp8266React.loop();
// run the demo project's loop function // run the demo project's loop function
demoProject.loop(); demoProject.loop();

View File

@ -17,6 +17,8 @@ void setup() {
// start the framework and demo project // start the framework and demo project
esp8266React.begin(); esp8266React.begin();
// start the demo project
demoProject.begin(); demoProject.begin();
// start the server // start the server