Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#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
You can’t perform that action at this time.