Improved Touch Gesture Solution

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
JoSy_3545721
Level 1
Level 1
Code Expert

I thought I would share an improved touch gesture solution. Please try it out and I would appreciate any feedback.

I started out with the CY8CKIT-044 Touch Gesture example and found the solution overly complicated and difficult to modify. I rewrote the "DetermineActiveButton()" and "DetectGesture()" functions. The concept was to capture 3 button sequence and compare that button sequence to gesture patterns defined in an array "swipe_pattern". This can be easily expanded to include other patterns like across and down, [LEFT, CENTER, DOWN]. Also, the original clockwise and counter_clockwise patterns required 5 buttons sequence to detect the first gesture and a further 3 button sequence to detect a continuing sequence.. I modified this so that only 3 buttons are required to detect a clockwise or counter_clockwise gesture and only one more button to detect a continuing sequence. The clockwise and counter_clockwise gestures work really nicely. Look how quickly the LED color changes with circular patterns.

I also left the logger feature in the project as it was very helpful in debugging this solution.

GitHub - isyq/logger: A log system for PSoC project

Regards,

John

0 Likes
1 Reply
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi JoSy_3545721,

Thank you for your interest in Cypress products. We believe that your solution will help a lot of other Cypress community users. Keep posting more projects in our community and help us grow

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes