7.4 Gesture Implementation
Out of all available gestures, the tap and swipe gestures are used in this application demo. The gesture configuration is as follows:
Parameter | Value |
---|---|
Tap time-out | 200 ms |
Swipe time-out | 700 ms |
Tap area | 20 |
Horizontal and vertical swipe distance | 30 |
Gesture measurement period | 10 ms |
The gesture detection algorithm of the Microchip Touch Library detects valid tap and swipe gestures events (i.e., up, down, left, and right) on the touch surface. The appropriate gesture detect flag bit is set to a valid tap or swipe gesture event. The application code reads the gesture information and sets the snake direction according to the command received.