Long Button Press (3seconds) on CapSense P4 v5 10

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

cross mob
ArTa_4831151
Level 1
Level 1

Hi,

I have designed a Slider and one button at the beginning of the slider using the PSoC 4 MCU. I want to add a press and hold feature to this , so that it should allow the user to press and hold the button for more than 3 seconds.

Currently I see that the maximum long press time is 1.5s. If I keep pressing for more than 1.5seconds , I see that it is treated as no input(LOW) or no button press on my STM32MCU (main controller of this application) .

Please help me how to achieve this.

Thanks a lot!
Arshiya

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.

Hi ArTa_4831151​,

As per my understanding, you want to detect two events, a) press and hold for 1 second b) press and hold for 3 seconds. You can use the attached source file to detect long press event based on the time for which they were pressed and held. Please let us know if this helps.

Regards,

Bragadeesh

Regards,
Bragadeesh

View solution in original post

0 Likes
3 Replies
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi ArTa_4831151​,

You can refer the following article to detect long press events:

Measuring Duration of CapSense Button Press Using SysTickTimer - KBA226863

Please check if you are using sensor auto reset enabled feature. This will reset the baseline after pre-determined duration based on the coefficient of N. If N is low, baseline update is slow. If N is high, baseline update rate is fast. If you want to change the duration for which the sensor should report ON, you can refer the following code example.

https://www.cypress.com/documentation/code-examples/ce229140-psoc-4-capsense-custom-baseline-reset

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes

Hi Bragadeesh,

Thank you for the reply.

I forgot to mention that I need to detect two types of touch actually, one is 1second and the other is 3 second. I don't want to change the duration for which the sensor should remain ON.

What solution would you recommend based on this information?

Thank you,

Arshiya Tabassum

0 Likes
lock attach
Attachments are accessible only for community members.

Hi ArTa_4831151​,

As per my understanding, you want to detect two events, a) press and hold for 1 second b) press and hold for 3 seconds. You can use the attached source file to detect long press event based on the time for which they were pressed and held. Please let us know if this helps.

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes