Where "serviceRoutineName" is the name you gave your interrupt routine ...currently "ISR1"
In my view, putting a delay in your ISR is fine so long as you understand the implications. In my case I had no indication that the routine was wrongly defined by the compiler, and it took some research to figure it out.
I think that the Reference section about attaching the ISR on the Arduino needs updating to say words about how to create the ISR in the first place....the example should not work too.
happymacer:
Hiya, I'm a newbie too, but had trouble using external interrupts too. I may be quite wrong but I think you have defined the ISR wrongly....
Using attachInterrupt() you can use any name for your interupt service routine.
I suggest writing a much more simple sketch just to test the interrupt.
And don't attempt to do anything in the interrupt routine, except to set some kind of flag variable ( which must be volatile ), and then check the status of that variable, in loop( )
What are these supposed to be doing? That is not how to call a function, if that is what you were trying to do.
Also, you've said nothing about what is supposed to trigger this interrupt, but whatever it is, you are going about this all wrong. An interrupt is like the alarm going off. It need to be handled now, and it needs to be handled quickly. It is not like a doorbell ringing, where the person ringing the doorbell could wait a few seconds.
happymacer:
In my view, putting a delay in your ISR is fine so long as you understand the implications.
The implications are that it won't work.
Interrupts are almost never the most sensible way to respond to button presses. I doubt that it is the best way here.
I strongly dislike the way you have implemented code as preprocessor macros. Putting code in macros is poor practice at the best of times, but especially when it doesn't maintain correct language syntax at the point the macros are used.
In my view, putting a delay in your ISR is fine so long as you understand the implications.
Since delay() relies on interrupts, which don't happen while an ISR is running, the "implications" are that the code will freeze. As long as your are fine with the Arduino entering a block of code that it can never exit from, feel free to do stupid things like call delay() in an ISR.