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:

Table 7-3. Gesture Configuration Parameters
ParameterValue
Tap time-out200 ms
Swipe time-out700 ms
Tap area20
Horizontal and vertical swipe distance30
Gesture measurement period10 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.