Skip to content

Instantly share code, notes, and snippets.

@futureshocked
Last active June 10, 2016 05:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save futureshocked/53f24f97c3852b77d5cc030a2852810c to your computer and use it in GitHub Desktop.
Save futureshocked/53f24f97c3852b77d5cc030a2852810c to your computer and use it in GitHub Desktop.
volatile int a; //A variable which is also access by an interrupt service routine
void loop(){
a = 1;
int b;
b = a + 1;
Serial.println(b);
}
void isr0 () {
detachInterrupt(0);
a = 5;
attachInterrupt (0, isr0, RISING);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment