Created
April 10, 2015 18:52
-
-
Save ShawnHymel/65cd4c1c1bbb097ab62e to your computer and use it in GitHub Desktop.
#670247 Gesture Sketch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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