Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By Barnabybear
#59347 Hi, I’m sure someone will answer your question directly but from my experience, I had lots of problems with WDT resets if I used any sort of lengthy interrupt routine. To get round this I used the interrupt routine to set a flag and exit the interrupt, this was then picked up but the main body of the sketch. I know this may not suit all applications but it works for me.
Code: Select all  attachInterrupt(0, zero_cross, FALLING);

Code: Select allvoid zero_cross() {
  zero_cross_trig = true;}

Code: Select allvoid loop() {

  while (!zero_cross_trig);
// your interrupt code here
    zero_cross_trig = false;