- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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)
Solved! Go to Solution.
- Labels:
-
PSoC 4 MCU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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