I have this code in an ISR that is successfully being triggered continuously from an MCP23017.
There is a LED attached to pin 11.
void ISR1()
{
digitalWrite(11, HIGH);
bISR1 = true;
}
At the top of my loop function I have this code that is supposed to turn the LED off but the call to digitalWrite(11, LOW); is failing for some reason.
if (bISR1)
{
digitalWrite(11, LOW);
mcp.clearInts();
bISR1 = false;
Serial.println(F("Interrupt 1 generated..."));
}
Every time I trigger the interrupt on the MCP I see the text "Interrupt 1 generated..." in my serial monitor.
So the only thing that is wrong is the call to digitalWrite(11, LOW) that is failing to change the pin state.
Why would this be occurring?
Are there issues with using digitalWrite(...) in an ISR?