if I write a code that includes interrupts. Also, the main loop depends mainly on an if and if else statement. After the interrupt is triggered and finalized, the program would run back normally. My question is, when it goes back to the main loop, would it check the main if statement or it will pick up from where it stopped regardless of the if statement?
for example:
void setup()
{
attachInterrupt(digitalPinToInterrupt(2),BUCK,RISING);
}
void loop()
{
if (Flag == 1){
i= 1;
Flag = 0;}
if (Flag == 0){
z= 1;}
}
void BUCK()
{
digitalWrite(Switch, LOW);
delayMicroseconds(200);
Flag = 1;
}
would it check for the condition of Flag after getting back from the interrupt first, or it will pick from where it stopped?