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

wifi going down #17

Open
sova32 opened this issue Apr 29, 2024 · 4 comments
Open

wifi going down #17

sova32 opened this issue Apr 29, 2024 · 4 comments

Comments

@sova32
Copy link

sova32 commented Apr 29, 2024

you use
delay();
and
sleep();
func`s.
Dont do it.
It is bad idea. Use millis() function or library based on internal timer.

@suoapvs
Copy link
Owner

suoapvs commented Apr 29, 2024

This code was written 5 years ago. I have no idea what you're talking about anymore. I'm no longer interested in changing anything. You can download the code and make your changes.

@sova32
Copy link
Author

sova32 commented Apr 29, 2024

Some lib`ss like AsyncWebServer or if you use wi-fi on your microcontroller, it going down when delay() or sleep() present in code.
it is very goon lib but in
AverageThermistor.cpp
and
SmoothThermistor.cpp
you must use millies()
some like this

unsignet int delay = 1000; // 1 second for example
unsignet int preM = 0;
loop(){
    if (millies() >= preM+delay){
        // your code here
        preM = millies;
}

good luck bro!

@sova32
Copy link
Author

sova32 commented Apr 29, 2024

This code was written 5 years ago. I have no idea what you're talking about anymore. I'm no longer interested in changing anything. You can download the code and make your changes.
Друже! ти з України?!
Як ся маєш?
Я хотів би розпитати в тебе дещо про GoIT. Ми б не могли перемовитись парой слів?

@suoapvs
Copy link
Owner

suoapvs commented Apr 29, 2024

I can change sleep() function:

inline void AverageThermistor::sleep() {
  unsigned long start = millis();
  while (millis() - start < this->delayTime) {
    // wait
  }
}

Review the code, please

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

No branches or pull requests

2 participants