NTC_Thermistor icon indicating copy to clipboard operation
NTC_Thermistor copied to clipboard

wifi going down

Open sova32 opened this issue 1 year ago • 4 comments
trafficstars

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

sova32 avatar Apr 29 '24 08:04 sova32

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.

suoapvs avatar Apr 29 '24 08:04 suoapvs

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 avatar Apr 29 '24 08:04 sova32

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. Ми б не могли перемовитись парой слів?

sova32 avatar Apr 29 '24 08:04 sova32

I can change sleep() function:

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

Review the code, please

suoapvs avatar Apr 29 '24 18:04 suoapvs