I am trying to attach an interrupt with 1ms timeout. When the interrupt occurs, I want the remainder of the program to be executed, else I want it to print an error.
I understand that we can use the Function
in the attachInterrupt()
to execute small piece of code when the Interrupt occurs, but I want to execute the remainder of my program (with several functions) with return values, How can I achieve this ?
Below is the code that I am working with.
int interruptDetected = 0; // Defining a global variable
while(timeElapsed < 1)Â Â attachInterrupt(D0,interruptFunction,FALLING); // Timing out the attachInterrupt in 1ms and calling the interruptFunction when interrupt is detected
if(interruptDetected==1){"Here I would run the remainder of the program"};
else Serial.println('Error routine: Clock does not start');
void interruptFunction()
{
interruptDetected =1;
}