Skip to content

Commit

Permalink
update: fix example mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
asjdf committed Feb 25, 2023
1 parent ec6abdb commit b95e0eb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion examples/demo/demo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,14 @@ void setup() {
void loop() {
delay(2000);

// we suggest you to use `print + "\n"` instead of `println`
// because the println will send "\n" separately, which means
// it will cost a sending buffer just for storage "\n". (there
// only 8 buffer space in ESPAsyncWebServer by default)
WebSerial.print(F("IP address: "));
WebSerial.println(WiFi.localIP());
// if not use toString the ip will be sent in 7 part,
// which means it will cost 7 sending buffer.
WebSerial.println(WiFi.localIP().toString());
WebSerial.printf("Millis=%lu\n", millis());
WebSerial.printf("Free heap=[%u]\n", ESP.getFreeHeap());
}
8 changes: 7 additions & 1 deletion examples/demo_ap/demo_ap.ino
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,14 @@ void setup() {
void loop() {
delay(2000);

// we suggest you to use `print + "\n"` instead of `println`
// because the println will send "\n" separately, which means
// it will cost a sending buffer just for storage "\n". (there
// only 8 buffer space in ESPAsyncWebServer by default)
WebSerial.print(F("IP address: "));
WebSerial.println(WiFi.localIP());
// if not use toString the ip will be sent in 7 part,
// which means it will cost 7 sending buffer.
WebSerial.println(WiFi.localIP().toString());
WebSerial.printf("Millis=%lu\n", millis());
WebSerial.printf("Free heap=[%u]\n", ESP.getFreeHeap());
}

0 comments on commit b95e0eb

Please sign in to comment.