Skip to content

Instantly share code, notes, and snippets.

@ShawnHymel
Created April 10, 2015 18:52
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 ShawnHymel/65cd4c1c1bbb097ab62e to your computer and use it in GitHub Desktop.
Save ShawnHymel/65cd4c1c1bbb097ab62e to your computer and use it in GitHub Desktop.
#670247 Gesture Sketch
void loop() {
switch (state){
case ‘R’:
if( isr_flag == 1 ) {
delay(5000);
detachInterrupt(0);
handleGesture();
digitalWrite(9, LOW);
isr_flag = 0;
Serial.println(“STATE R”);
state= ‘X’;
attachInterrupt(0, interruptRoutine, FALLING);
break;
} //Serial.println(“delay”);
digitalWrite(9, HIGH);
case 'X':
if (isr_flag == 1) {
delay(5000);
detachInterrupt(0);
handleGesture();
digitalWrite(9, LOW);
Serial.println("STATE X");
isr_flag=0;
state = 'R';
attachInterrupt(0, interruptRoutine, FALLING);
break;
}
digitalWrite(9, HIGH);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment