Hi friends, i want to know, is there any way to control any interrupt pin in this way :
if(something is true)
{
let external interrupt pin (for example INT0 pin) react to actions
}
else
{
does not matter whatever happens, dont let external pin to react anything
}
i am using arduino mega, and planning use all 7 interrupt pins, even PCINT pins, but i dont need my external interrupt pins react everytime to everything.
so i cant use cli(); because it will disable all interrupts
I realise that your code was only an example but do not expect Serial.print() to work reliably in an ISR because it uses interrupts and they are disabled when in an ISR. I seem to remember some talk of a proposal to change this but I am not sure whether it was ever implemented
One question that does arise is whether you need to use interrupts in the first place. What is the application ?
my application is about controlling ac motor speed with zero cross detection circuit. there are some other menu functions, screen, sensors, buttons and etc. actually i cant post the code because it is very long and complicated.
and i want my INT0 pin react to zero cross detection optocoupler only when i decide from menu.