Skip to content

added an example to switch LED using ESP8266WebServer#8590

Open
nsisong wants to merge 2 commits intoesp8266:masterfrom
nsisong:example
Open

added an example to switch LED using ESP8266WebServer#8590
nsisong wants to merge 2 commits intoesp8266:masterfrom
nsisong:example

Conversation

@nsisong
Copy link
Copy Markdown

@nsisong nsisong commented May 31, 2022

No description provided.

@mcspr
Copy link
Copy Markdown
Collaborator

mcspr commented May 31, 2022

We do have a lot of LED switching already though, check out PostServer & AdvancedWebServer

Also... instead of String, please use PROGMEM'ed strings (static const char x[] PROGMEM = "...";) by using ..._P() methods! Current behaviour with string literals is that they are placed into RAM, and every contents will also be duplicated into String buffer. That would be the only improvement I could think of :)

@cziter15
Copy link
Copy Markdown
Contributor

cziter15 commented Dec 16, 2022

Why changing led pin state in main loop function? You end up with unnecessary digitalWrite call on each loop ;)

Anyway, you should consider adding delay(1) or yield in your loop function. Not sure, maybe http server does that already. This will prevent watchdog related issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants