This makes sense if Start_BUTTON_pin
is the pin connected to the button … I had assumed, that the pin you wanted to monitor was Start_BUTTON_INTpin
.
What is that pin connected to?
Also, you should probably do something like this (just to get into the good habit of not doing too much in your interrupt routine.
void loop()
{
// This will make sure you are not interrupted whilst reading the *volatile*
// variable remember that ISRs have a higher priority than loop()
__disable_irq();
bool triggered = Start_BUTTON_triggered;
Start_BUTTON_triggered = false;
// Don't forget to reenable the interrupt
__enable_irq();
if(triggered)
digitalWrite(red_LED_pin, !digitalRead(red_LED_pin));
}
// Do as little as possible in your interrupt routine
void interrupt1()
{
Start_BUTTON_triggered = true;
}