update readme with changes to the demo code
This commit is contained in:
parent
41f7579bd5
commit
d0fb2d982a
18
README.md
18
README.md
@ -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,14 +272,16 @@ 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();
|
||||||
|
|
||||||
|
// start the demo project
|
||||||
|
demoProject.begin();
|
||||||
|
|
||||||
// begin the demo project
|
|
||||||
demoProject.init(&server);
|
|
||||||
|
|
||||||
// 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();
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user