- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How can i use one capsense button with two event . Example if i am pressing capsense for 5 sec it will work for event number 2 @
Solved! Go to Solution.
- Labels:
-
PSoC 4 MCU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @iammyur
You can do this with the help of a timer block. I am attaching a project that calls 2 functions based on the CapSense status. A short press will call Function1 and a long press (of 5 seconds) will call function2. I have prepared this for the 145-40XX kit, but you can port it to any device.
Best regards,
Hari
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @iammyur
You can do this with the help of a timer block. I am attaching a project that calls 2 functions based on the CapSense status. A short press will call Function1 and a long press (of 5 seconds) will call function2. I have prepared this for the 145-40XX kit, but you can port it to any device.
Best regards,
Hari
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Hari
Thank you for this.
Now my question is when i pressing button for 5 sec. it will call function 2 . After sometime (5 to 10 Sec.) . if i am pressing button for short time it will automatically come back to function 1 ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
> I not get my answer yet. Please help me !
I wonder if Hari-san's sample above did not work for you?
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @iammyur
If you have a lift off, that is, after 5 seconds if you remove your finger and then place it for a short period, it will call function 1 again.
Best regards,
Hari
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
First of all, I have never tried such CapSense usage,
so the followings are my idea.
If I were you, I would start timer (time count), probably using the SysTick, and count time till the button is released.
And if the button is released before 5 sec arrives, I trigger the event number 1,
or if 5 seconds expires, I trigger the event number 2.
Note: At this point, I don't know if I should trigger the event number 1 at the time the button was touched,
or I should wait until the button is released or kept longer than 5 secs.
moto