Go Down

Topic: WDT reset on delay() ? (Read 927 times) previous topic - next topic

darksir

Hi boys,
please, can you help me? I ´am using sketch with wdt timer ON. Is possible to reset wdt timer in delay() function?
When I call delay(5000), my wdt is overrun.
Is any other way to reset wdt in delay as use 5x 1000mS delay with wdt_reset() after every seconds?

Many thanks,
Petr

PaulS

Quote
Is any other way to reset wdt in delay as use 5x 1000mS delay with wdt_reset() after every seconds?

No. Screwing around with smaller values in the call to delay() is not the answer either. Reading, understanding, and embracing the blink without delay example is.

darksir

OK, thanks :-) But it´s not easy solution of simple problem :-)))))))

So, I will be experimenting with timing of main loop :-) But only in my second program... today I have made multiple delays of one second...

I created a nice function for it :-)


Code: [Select]

void delayS(int number)
{
     for (int i=0; i < number; i++){
    wdt_reset(); // reset the wdt
    delay(1000);               // wait for a second
     } 
}


Go Up