Announcements

Equip yourself to optimize PSoc4 MCUs for Evs at the EV Webinar. Click here to register.

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

PSoC™ 4 Forum Discussions

saurabh
Level 3
Level 3
50 sign-ins 25 sign-ins 10 replies posted

Hello everyone,

Is there any way to get slider on release detection? I've been trying to implement slider functionality and getting continuous slider values which I need only on release. (PSoC4 MCU CY8c4245AXI-483)

0 Likes
1 Solution
MotooTanaka
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

Hi,

I'm afraid that when released, we can not get meaningful value from the slider.

So I would always record the value as last vale and when detect that the slider is not touched anymore,

use the newest last value (funny English?).

 

In the example of the previous discussion, I would try

https://community.infineon.com/t5/PSoC-4/Capsense-slider/td-p/323873

(1) Always get the slider value when CapSense_IsWidgetActive(CapSense_LINEARSLIDER0_WGT_ID)

(2) In the block where I commented as /* Liner Slider is not touched */, 
   assign the saved value as the last value (or the value at release).

  Then probably, clear the "last value" to avoid using the value again.

 

moto

View solution in original post

0 Likes
3 Replies
MotooTanaka
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

Hi,

I'm afraid that when released, we can not get meaningful value from the slider.

So I would always record the value as last vale and when detect that the slider is not touched anymore,

use the newest last value (funny English?).

 

In the example of the previous discussion, I would try

https://community.infineon.com/t5/PSoC-4/Capsense-slider/td-p/323873

(1) Always get the slider value when CapSense_IsWidgetActive(CapSense_LINEARSLIDER0_WGT_ID)

(2) In the block where I commented as /* Liner Slider is not touched */, 
   assign the saved value as the last value (or the value at release).

  Then probably, clear the "last value" to avoid using the value again.

 

moto

0 Likes

Thank you,

I am currently working on the same. Could you also share (if any) suggestion on double tap, single tap, long press in the similar microcontroller?

0 Likes
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi @saurabh 

 

The double and single tap needs to be detected using custom logic. You can use a timer to keep a track of the duration of press. The timer will start counting whenever the sensor is active. If it is active for more than a set duration, it can be counted as long press. 

Else, once inactive, you can start the timer again to see if the sensor is active again within a set window for double-tap functionality. 

These features are implemented in the latest CapSense IP with the 4000S series devices. You can take a look at CapSense gestures in case you can change the device so that the implementation is easier...

 

Best regards, 
Hari

0 Likes