Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added an example to switch LED using ESP8266WebServer #8590

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nsisong
Copy link

@nsisong nsisong commented May 31, 2022

No description provided.

@mcspr
Copy link
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
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